Jump to content

Need help with If Statement


mkessler

Recommended Posts

I'm trying to script an If statement for my Google Ad so that it only loads when results do. I know I should add the Ad script to my javascript I'm making calls from, but Google recommends placing it within the actual HTML of the page. Here's what I tried use below, but it only created a box with an error message. If anyone has any tips on how to script this I would greatly appreciate it!If statement:

<script type="text/javascript">if (dataResults)  {  <!--google_ad_client = "pub-*******";/* 300x250, created 11/2/10 */google_ad_slot = "*******";google_ad_width = 300;google_ad_height = 250;//--><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>  }</script>

Google Ad:

<script type="text/javascript"><!--google_ad_client = "pub-***********";/* 300x250, created 11/2/10 */google_ad_slot = "*********";google_ad_width = 300;google_ad_height = 250;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...