的iFrame在jQuery Mobile的應用程序導致錯誤:Unsafe JavaScript attempt to access frame with URL file:///D:/xx/webpage.html from frame with URL http://www.asp.net/. Domains, protocols and ports must match.
的iFrame在jQuery Mobile的應用程序導致錯誤
我正在開發使用iframe來加載外部網站jQuery的移動應用程序。
我的腳本代碼是:
$(document).ready(function() {
$('#divID').prepend('<img src="http://xxx/images/ICPosternew1002.png" usemap="#map" id="image" style="margin-top:43px;"/>')
$('#map').append('<area coords="30,0,60,30" id="1" alt="Blah" title="asp" />')
$("#1").bind("click", function (e) {
e.preventDefault();
$('#Web1').append('<form id="form1" runat="server" rel="external"></form>')
$('#form1').append('<iframe id="iframe1" src="http://asp.net" frameborder="0" rel="external"></iframe>')
});
});
我在我的應用程序的兩個虛擬頁。點擊主頁上的圖像地圖後,加載第二頁與iFrame和相應的網站。
<div data-role="page" id="Web" class="pagebody">
<div data-role="header" data-position="inline" data-theme="a">
<!--header-->
</div>
<div data-role="content" id="Web1">
<form id="form1" runat="server">
<iframe id="iframe1" >
</iframe>
</form>
</div>
<div data-role="footer" class="footer">
<!--footer-->
</div>
</div>
這是我的代碼問題嗎?