MrDeranged
Well-known member
Hey All,
Not even sure if what I'm trying to do is possible. I'd just like to know if it is and if I'm on the right track to do so.
I use openx to serve my ads. I've created 3 zones, 728x90, 468x60 and 320x50.
There are invocation codes for each zone. I'm hoping that I'll be able to call the invocation code based on client width. below is the code that I have in the ad template. Not sure if this is even possible.....
<xen:hook name="ad_below_top_breadcrumb" />
<script type="text/javascript">
width = document.documentElement.clientWidth;
if (width > 744) {
<script type='text/javascript'><!--//<![CDATA[
var m3_u = (location.protocol=='https:'?'https://****/****/****/****/ajs.php':'http://****/****/****/****/ajs.php');
var m3_r = Math.floor(Math.random()*99999999999);
if (!document.MAX_used) document.MAX_used = ',';
document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
document.write ("?zoneid=12");
document.write ('&cb=' + m3_r);
if (document.MAX_used != ',') document.write ("&exclude=" + document.MAX_used);
document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));
document.write ("&loc=" + escape(window.location));
if (document.referrer) document.write ("&referer=" + escape(document.referrer));
if (document.context) document.write ("&context=" + escape(document.context));
if (document.mmm_fo) document.write ("&mmm_fo=1");
document.write ("'><\/scr"+"ipt>");
//]]>--></script><noscript><a href='http://****/****/****/****/ck.php?n=aef55404&cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://****/****/****/****/avw.php?zoneid=12&cb=INSERT_RANDOM_NUMBER_HERE&n=aef55404' border='0' alt='' /></a></noscript>
}
if (width > 484) {
<script type='text/javascript'><!--//<![CDATA[
var m3_u = (location.protocol=='https:'?'https://****/****/****/****/ajs.php':'http://****/****/****/****/ajs.php');
var m3_r = Math.floor(Math.random()*99999999999);
if (!document.MAX_used) document.MAX_used = ',';
document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
document.write ("?zoneid=13");
document.write ('&cb=' + m3_r);
if (document.MAX_used != ',') document.write ("&exclude=" + document.MAX_used);
document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));
document.write ("&loc=" + escape(window.location));
if (document.referrer) document.write ("&referer=" + escape(document.referrer));
if (document.context) document.write ("&context=" + escape(document.context));
if (document.mmm_fo) document.write ("&mmm_fo=1");
document.write ("'><\/scr"+"ipt>");
//]]>--></script><noscript><a href='http://****/****/****/****/ck.php?n=ac818485&cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://****/****/****/****/avw.php?zoneid=13&cb=INSERT_RANDOM_NUMBER_HERE&n=ac818485' border='0' alt='' /></a></noscript>
}
if (width < 484) {
<script type='text/javascript'><!--//<![CDATA[
var m3_u = (location.protocol=='https:'?'https://****/****/****/****/ajs.php':'http://****/****/****/****/ajs.php');
var m3_r = Math.floor(Math.random()*99999999999);
if (!document.MAX_used) document.MAX_used = ',';
document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
document.write ("?zoneid=14");
document.write ('&cb=' + m3_r);
if (document.MAX_used != ',') document.write ("&exclude=" + document.MAX_used);
document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));
document.write ("&loc=" + escape(window.location));
if (document.referrer) document.write ("&referer=" + escape(document.referrer));
if (document.context) document.write ("&context=" + escape(document.context));
if (document.mmm_fo) document.write ("&mmm_fo=1");
document.write ("'><\/scr"+"ipt>");
//]]>--></script><noscript><a href='http://****/****/****/****/ck.php?n=a0d43933&cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://****/****/****/****/avw.php?zoneid=14&cb=INSERT_RANDOM_NUMBER_HERE&n=a0d43933' border='0' alt='' /></a></noscript>
}
</script>
What I'm getting is this:
Any help greatly appreciated!!!
Thanks
Not even sure if what I'm trying to do is possible. I'd just like to know if it is and if I'm on the right track to do so.
I use openx to serve my ads. I've created 3 zones, 728x90, 468x60 and 320x50.
There are invocation codes for each zone. I'm hoping that I'll be able to call the invocation code based on client width. below is the code that I have in the ad template. Not sure if this is even possible.....
<xen:hook name="ad_below_top_breadcrumb" />
<script type="text/javascript">
width = document.documentElement.clientWidth;
if (width > 744) {
<script type='text/javascript'><!--//<![CDATA[
var m3_u = (location.protocol=='https:'?'https://****/****/****/****/ajs.php':'http://****/****/****/****/ajs.php');
var m3_r = Math.floor(Math.random()*99999999999);
if (!document.MAX_used) document.MAX_used = ',';
document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
document.write ("?zoneid=12");
document.write ('&cb=' + m3_r);
if (document.MAX_used != ',') document.write ("&exclude=" + document.MAX_used);
document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));
document.write ("&loc=" + escape(window.location));
if (document.referrer) document.write ("&referer=" + escape(document.referrer));
if (document.context) document.write ("&context=" + escape(document.context));
if (document.mmm_fo) document.write ("&mmm_fo=1");
document.write ("'><\/scr"+"ipt>");
//]]>--></script><noscript><a href='http://****/****/****/****/ck.php?n=aef55404&cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://****/****/****/****/avw.php?zoneid=12&cb=INSERT_RANDOM_NUMBER_HERE&n=aef55404' border='0' alt='' /></a></noscript>
}
if (width > 484) {
<script type='text/javascript'><!--//<![CDATA[
var m3_u = (location.protocol=='https:'?'https://****/****/****/****/ajs.php':'http://****/****/****/****/ajs.php');
var m3_r = Math.floor(Math.random()*99999999999);
if (!document.MAX_used) document.MAX_used = ',';
document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
document.write ("?zoneid=13");
document.write ('&cb=' + m3_r);
if (document.MAX_used != ',') document.write ("&exclude=" + document.MAX_used);
document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));
document.write ("&loc=" + escape(window.location));
if (document.referrer) document.write ("&referer=" + escape(document.referrer));
if (document.context) document.write ("&context=" + escape(document.context));
if (document.mmm_fo) document.write ("&mmm_fo=1");
document.write ("'><\/scr"+"ipt>");
//]]>--></script><noscript><a href='http://****/****/****/****/ck.php?n=ac818485&cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://****/****/****/****/avw.php?zoneid=13&cb=INSERT_RANDOM_NUMBER_HERE&n=ac818485' border='0' alt='' /></a></noscript>
}
if (width < 484) {
<script type='text/javascript'><!--//<![CDATA[
var m3_u = (location.protocol=='https:'?'https://****/****/****/****/ajs.php':'http://****/****/****/****/ajs.php');
var m3_r = Math.floor(Math.random()*99999999999);
if (!document.MAX_used) document.MAX_used = ',';
document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
document.write ("?zoneid=14");
document.write ('&cb=' + m3_r);
if (document.MAX_used != ',') document.write ("&exclude=" + document.MAX_used);
document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));
document.write ("&loc=" + escape(window.location));
if (document.referrer) document.write ("&referer=" + escape(document.referrer));
if (document.context) document.write ("&context=" + escape(document.context));
if (document.mmm_fo) document.write ("&mmm_fo=1");
document.write ("'><\/scr"+"ipt>");
//]]>--></script><noscript><a href='http://****/****/****/****/ck.php?n=a0d43933&cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://****/****/****/****/avw.php?zoneid=14&cb=INSERT_RANDOM_NUMBER_HERE&n=a0d43933' border='0' alt='' /></a></noscript>
}
</script>
What I'm getting is this:
Any help greatly appreciated!!!
Thanks