`
chun521521
  • 浏览: 277058 次
  • 性别: Icon_minigender_1
  • 来自: 长春
社区版块
存档分类
最新评论

js跨域调用父类方法

 
阅读更多

 

1.iframe中jsp写法


<input type="button" value="aaaa" onclick="test123();" />
<script type="text/javascript">
function test123(){
 alert('iframe页面');
 
 var js= document.createElement("script");
 js.type="text/javascript";
  js.src = "http://ip1:port1/uias/uias/login/login1.js";
 document.getElementsByTagName("head")[0].appendChild(js);
}

 

2.父类中写法

<iframe id="pframe" style="width:800px; height:200px; border: 1px solid red;"
src="http://ip2:port2/uiasmag/uias21/uiasLogin/loginMagPassword.jsp"></iframe>
</div>

 

3.父类login1.js

alert('iframe父页面方法');

 

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics