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>

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

Metalix,

That's all you have to do sometimes.

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

Airshow

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.