JSONP with document.write -


i'am loading script jspnp-like

var s = document.createelement("script"); s.src = "http://scripturl"; s.type = "text/javascript"; document.getelementbyid("ad").appendchild(s); 

when script contains alert works. real script needs "document.write". document.write never output. ideas why? script console not show errors.

this question is similar questions found

http://www.webmasterworld.com/javascript/4401935.htm and

document.write in jsonp callback

it seems calling document.write() calling document.open(), erases have written. time document.write() executed, page has finished loading.

take @ solutions provided in links above , try modifying them specific needs. try using iframe , write that.


Comments

Popular posts from this blog

C# random value from dictionary and tuple -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -