2014-06-10 2 views
0

I'am와 스크립트 jspnp 같은JSONP는 document.write를

var s = document.createElement("script"); 
s.src = "http://scripturl"; 
s.type = "text/javascript"; 
document.getElementById("ad").appendChild(s); 

로드. 그러나 실제 스크립트는 "document.write"해야합니다. 그러나 document.write는 출력되지 않습니다. 어떤 아이디어? 스크립트 콘솔에 오류가 표시되지 않습니다. 이 질문은

답변

0

는 질문에 비슷한) (document.write를 호출 모든 사용자가 삭제하는) (document.open 호출 것 같다

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

document.write in jsonp callback

을 발견하다 이전에 작성했습니다. document.write()가 실행될 때까지는 페이지가 이미로드를 완료했습니다.

위의 링크에서 제공되는 솔루션을 살펴보고 필요에 맞게 수정하십시오. iframe을 사용하여 시도해보십시오.

+0

hm iframe을 사용한 솔루션은 추악하지만 작동합니다 ... firefox ... opera ... chrome ... safai ... noch IE11! = (그는 단지 충돌합니다. – wutzebaer