呵呵,又见楼主。参考《Javascript权威指南》 P450
或上网搜索“同源策略”domain指documnet.domain
如,可以将orders.acme.com 和catalog.acme.com的document.domain设置成acme.com,但不能设置成xxxx.com
或上网搜索“同源策略”domain指documnet.domain
如,可以将orders.acme.com 和catalog.acme.com的document.domain设置成acme.com,但不能设置成xxxx.com
解决方案 »
- 下面这段JS代码,为什么输出的是undefined呢?
- 求javascript html css词典
- 关于javascript的简单问题
- js 判断 window.opener ,window.opener.top ,window.top 是否存在
- 15位身份证后面日期和顺序号的正则表达式是怎样的?
- 请教各位了,怎样实现一个连接当我点击后会加粗或着变为其他颜色,而当点击别的连接后前一又会变会原来的样式?
- 怎样屏蔽 ie的滚动条
- 通过javascript取样式表的值,求解!!
- 页面初始化问题
- 请问一个连接的问题
- 在FIREFOX中怎样不让用户选择页面中的内容?
- 网页中有个验证码,想做个按钮单独刷新验证码怎么做啊??
设置或获取文档的安全域名。语法:
object.domain[ = domain]设置(很简单的E文,希望你能看懂):This read-write property initially returns the host name of the server the page is from. It can be assigned the domain suffix to allow sharing of pages across frames. For example, a page in one frame from home.microsoft.com and a page from www.microsoft.com would initially not be able to communicate with each other. However, by setting the domain property of both pages to the suffix, microsoft.com, both pages would be considered secure and now access is available between the pages. 应用:
document
当两个页面在进行数据交换时,浏览器会首先比较两个页面的 domain 属性,如果 domain 属性相同,那么浏览器就允许它们之间的数据交换,否则就返回“拒绝访问(Access Denied)”的错误。通过蒙蔽浏览器,让它认为两个页面的 domain 属性相同从而实现两个不同域的页面之间的数据交换
。在 JavaScript 中我们可以通过在页面中加入如下声明来强制指定页面所属的域。<script language="JavaScript">
<!--
document.domain = "mycompany.com"; //指定 document 所属的域
-->
</script>