Forum Moderators: martinibuster
I have no knowledge of javascript at all.
Please, help me.
On my site there is
index.php?cat=widget
I want to stop showing Adsense ads if
widget actually "Red Widget" for instance.
I know how to do it in .php
But the problem is in templates and changes in php will mess up everything. I need to make it in javascript.
Thanks.
If it will work - I'll share why exactly I need it.
I had some observation.
<script type="text/javascript">
if (location.search.indexOf('cat=redwidget') > -1) {
document.write('<style type="text/css">div#ASdiv {display: none;}<\/style>');
}
</script>
.
.
.
<div id="ASdiv">
// AdSense code here
</div>
There is a specialized forum for javascript related subjects [webmasterworld.com], by the way.
It works,
but indeed it is not exactly what I needed ( I just realised it now only ).
Adsense code is still on the page it is just not showing. And it will be anyhow if it is Browser side of scripts. I need to go from server.
Thanks to all of You.
Tomorrow will try to figure out how to do it in PHP.