0

Hey guys!! been a while since I posted here, but thought I'd post this question here cause it is driving me insane!!

Basically,
if the condition returns true, then that part works.
but if it's false, neither part works.

If I put the content from the else after the <script> (so out of the condition) it runs.
but if i place it before the </script> it doesn't. ???

Any ideas?

Thank you in advance :D

<script type='text/javascript'>
<!--
var results = document.cookie.match ( '(^|;) ?sevisitor=([^;]*)(;|$)' );
if (sevisitor == true || results[2] == 1) {
	document.write('<script type="text/javascript"><!--\n\
	google_ad_client = "ca-pub-4654700332384357";\n\
	/* ad_content */\n\
	google_ad_slot = "4239136481";\n\
	google_ad_width = 336;\n\
	google_ad_height = 280;\n\
	//-->\n\
	</scr'+'ipt>\n\
	<script type="text/javascript"\n\
	src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\n\
	</scr'+'ipt>');
} else {
	document.write('<style type="text/css">\n\
	<!--\n\
	#blog_google_ads{\n\
	display:none;\n\
	}\n\
	-->\n\
	</style>');	
}
-->
</script>
2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Airshow
0

Nevermind problem solved, it was the cookie causing errors cause it didn't exist yet!! :D

0

Metalix,

That's all you have to do sometimes.

Post your problem on Daniweb and it sorts itself :icon_idea:

Airshow

Edited by Airshow: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.