I get the ad from JSON response, response is below,for example I get below response from JSOn object like "ad"
<script type="text/javascript">
document.write('<scr' + 'ipt src="//trk.diamondminebubble.com/h.html?e=hb_before_creative_renders&ho=2140340&ty=j&si=468x60&ta=16577&cd=cdn.marphezis.com&raid=4c56eeb6d&rimid=30af7b6d1&rbid=376879013&cb=' + Math.floor((Math.random() * 100000000000) + 1) + '&ref="></scr' + 'ipt>');
</script>
<script type="text/javascript">
var compassSmartTag = {
h: "2140340",
t: "16577",
d: "2",
referral: "",
y_b: {
y: "j",
s: "468x60"
},
hb: {
raid: "4c56eeb6d",
rimid: "30af7b6d1",
rbid: "376879013"
}
};
</script>
<script src="//cdn.marphezis.com/cmps/cst.min.js"></script>
<img src="http://notifications.iselephant.com/hb/awin?byid=400&imid=30af7b6d1&auid=4c56eeb6d&bdid=376879013" width="1" height="1" style="display:none" />
I need to load this ad in particular below div,
<div id="newdiv"></div>
document.getElementById('newdiv').innerHTML = ad;
The script loaded in div, but ad will not show. The above code just simply loads the script in the div. If the script will be run then only the ad will show. How do I run script after loaded to the div or is there any other way to show the ad in the div??? Any help is appreciated.