应用下的一个页面A,用iframe引用了另外一个域下的页面B
(注:2个是同一个父域)
页面B中引入了几个JS,由此牵涉出访问页面A的时候,显示页面B中的内容,但是浏览器
会提示跨域的问题这样的情况,应该如何修正呢?2个域我都可以操作,但是页面B以及JS无法更改采用过flash的方式,但是没测试成功,也不知道是不是写的有问题.
各位达人,有没有其他的方式来解决,有实例代码最好页面A :
<html>
<body style="margin:0px">
<iframe id="page1" name="course" src="" width=100% height=100% marginheight=0 frameborder=0 topmargin=0 leftmargin=0>
</iframe>
<script language="JavaScript" type="text/javascript">
page1.location.href = "页面B连接";
</script>
</body>
</html>页面B:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<link href="css/main.css" rel="stylesheet" type="text/css">
<script type="text/JScript.encode" SRC="scripts/aaa.js"></script>
<script type="text/JScript.encode" SRC="scripts/bbb.js"></script>
<script type="text/JScript.encode" src="scripts/ccc.js"></script>
.......................
(注:2个是同一个父域)
页面B中引入了几个JS,由此牵涉出访问页面A的时候,显示页面B中的内容,但是浏览器
会提示跨域的问题这样的情况,应该如何修正呢?2个域我都可以操作,但是页面B以及JS无法更改采用过flash的方式,但是没测试成功,也不知道是不是写的有问题.
各位达人,有没有其他的方式来解决,有实例代码最好页面A :
<html>
<body style="margin:0px">
<iframe id="page1" name="course" src="" width=100% height=100% marginheight=0 frameborder=0 topmargin=0 leftmargin=0>
</iframe>
<script language="JavaScript" type="text/javascript">
page1.location.href = "页面B连接";
</script>
</body>
</html>页面B:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<link href="css/main.css" rel="stylesheet" type="text/css">
<script type="text/JScript.encode" SRC="scripts/aaa.js"></script>
<script type="text/JScript.encode" SRC="scripts/bbb.js"></script>
<script type="text/JScript.encode" src="scripts/ccc.js"></script>
.......................
通过script更加不适合你的项目