2012-12-19 3 views
0

아주 간단합니다. 어도비의 AIR 응용 프로그램의 메인 윈도우는 html 파일, 그리고 application.xml을은 다음과 같습니다html과 javascript 배너를 사용하는 Adobe AIR는 실패합니다

<script type="text/javascript" 
    src="http://www.mysite.com/mybanner.js" id="add"></script> 
<script type="text/javascript"> 
    document.write("<h1>this is strange</h1>"); 
    alert(document.getElementById("add").src); 
    function getJS(){ 
     document.getElementById("add").src="http://www.mysite.com/mybanner.js"; 
     xmlhttp = new XMLHttpRequest(); 
     xmlhttp.open("GET", "http://www.mysite.com/mybanner.js" 
      ,false); 
     xmlhttp.send(null); 
     if (xmlhttp.status === 200) { 
      alert(xmlhttp.responseText); 
     eval(xmlhttp.responseText); 

     }else{ 
      throw("Can't open url, response status is:"+xmlhttp.status); 
     } 
    } 
</script> 
<input type="button" onclick="getJS();" value="getJS" /> 

가 표시 응용 프로그램을 열고 "이것이다 :

<initialWindow> 
    <title>window title</title> 
    <content>index.html</content> 

된 index.html은 다음과 같습니다 이상한 "하고 다른 스크립트 태그 (배너)의 소스를 경고하지만 아무것도 표시하지 않습니다. getJS 버튼을 클릭하면 js 파일의 내용이 경고되지만 아무 것도 표시되지 않습니다. 평가에서 AIR 런타임 보안 위반이 발생합니다. Internet Explorer 나 Firefox에서 파일을 열면 스크립트 나 src에 오류가 없도록 배너가 표시됩니다.

flashDevelop에서 실행하고 출력에 경고 또는 오류가 표시되지 않으며 xmlhttprequest (일반적으로 브라우저에서는 허용되지 않음)를 사용하여 모든 사이트에 연결할 수 있지만 서버에서 간단한 js 파일을로드 할 수 없습니다.

누구든지이 문제를 해결할 수 있습니까?

답변

0

원본 소스가 로컬이 아닌 경우 document.write가 작동하지 않습니다.

관련 문제