jQuery Append Ad JavaScript code inside DIV -


i want dynamically insert ad javascript code inside div

the div want use in body is:

<div class="madv" id="madv"></div> 

the ad javascript code needs inserted inside div:

<script type="text/javascript">    document.write('<scri' + 'pt type="text/javascript" src="'    + (document.location.protocol == 'https:' ? 'https://uat-secure' : 'http://ad-cdn')    + '.technoratimedia.com/00/81/95/uat_19581.js?ad_size=300x250"></scri' + 'pt>'); </script> 

the problem is javascript code contains many double quotes, single quotes , comments prevents rendering correctly.

what need ? script code using jquery or other method pass javascript ad code above head div in body. use : http://jsfiddle.net/0rnyhpcx/

try

document.write('<scri' + 'pt type=text/javascript src='    + (document.location.protocol == 'https:' ? 'https://uat-secure' : 'http://ad-cdn')    + '.technoratimedia.com/00/12/34/uat_123456.js?ad_size=300x250></scri' + 'pt>') 

Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -