jquery - How to use jsonp to get javascript based ad calls onto a page, asyncronously -
i trying use jsonp solve page performance problem i've been having. on site display ads writing out script tag document.write("<scr" + "ipt src='advendor.com\myad.php'></scr" + "ipt>");
. , except fact sites script tags point have nasty habit of being slow. when have page 5 ads on it can hold entire pages load time due blocking syncronous requests.
so idea make jsonp call ad service give me script tag needs written page. problem there <script>
tag on page but, script tag nothing. script work if written before document.ready?
clarification: have our server side code making calls ad serving system determines ad code server side(in script tag "src=" points vendors site, generates actual ad , tracking). i'm trying stop ad calls blocking loading of content. want content first , ads next. putting script tags @ bottom of page not acceptable solution because need determine ads appear on page. ie, <div id="adonehere"><script src="vendorssite.com"></script></div>
, can have many 5 of these ad calls on 1 page. each has own images/tracking/etc...
my problem similar 1 addressed here, except need "script" tag centralized server multiple domains, , need document.write inside specific dom element, i'm versed in jquery if helps.
document.write()
slow , pauses html parsing while running. insert ads dom on dom-ready. there no need pull <script>
-tag via jsonp. add small script right before closing </body>
-tag adds these <script>
-tags page needed.
Comments
Post a Comment