Created
June 27, 2011 03:59
-
-
Save danheberden/1048297 to your computer and use it in GitHub Desktop.
openX generated JS improvements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type='text/javascript'><!--//<![CDATA[ | |
// wrap in an IIFE to not pollute the global name space - also allows 'document', etc, to be minified | |
(function( window, document ) { | |
document.MAX_used = document.MAX_used || ','; | |
// omitting http or https will use whatever is currently being used. | |
var m3_u = '//www.domain.com/openx/www/delivery/ajs.php?', | |
escape = window.escape, | |
// place the params into an array to be joined with the & later | |
params = [ 'zoneid=10', | |
'cb=' + Math.floor( Math.random() * +new Date() ), | |
'charset=' + document.charset || docment.characterSet || '', | |
'loc=' + escape( window.location ) | |
]; | |
document.MAX_used != ',' && params.push( 'exclude=' + document.MAX_used ); | |
document.referrer && params.push( 'referer=' + escape( document.referrer ) ); | |
document.context && params.push( 'context=' + escape ( document.context ) ); | |
document.mmm_fo && params.push( 'mmm_fo=1' ); | |
// append the final result in ONE doc write | |
document.write( '<script src="' + m3_u + params.join( '&' ) + '"><\/script>' ); | |
})( window, document ); | |
//]]>--></script><noscript><a href='http://www.domain.com/openx/www/delivery/ck.php?n=a0da2d4d&cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://www.domain.com/openx/www/delivery/avw.php?zoneid=10&cb=INSERT_RANDOM_NUMBER_HERE&n=a0da2d4d' border='0' alt='' /></a></noscript> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment