标签:sch win jsonp alert 方式 type csdn 开发 var
<html> <head> <script> document.domain = "xx.com"; function a(){ alert("p"); } </script> </head> <body> <iframe src="http://localhost:8080/CmsUI/2.html" id="i"> </iframe> <script> document.getElementById(‘i‘).onload = function(){ var d = document.getElementById(‘i‘).contentWindow; d.aa(); }; </script> </body> </html>
<html> <head> <script> document.domain = "xx.com"; function aa(){ alert("c"); } </script> </head> <body> </body> </html>
出处:http://my.oschina.net/lwaif/blog/481154?p={{totalPage}}
http://www.jb51.net/article/48794.htm javascript跨域的4种方法和原理详解
http://blog.csdn.net/joyhen/article/details/21631833 前端解决跨域问题的8种方案(最新最全)
标签:sch win jsonp alert 方式 type csdn 开发 var
原文地址:http://www.cnblogs.com/hongsonz/p/6824441.html