1.htm页面设置document.domain = window.location.host.match(/[^.]+\.[^.]+$/)[0];//设置当前页面域名
当主域、协议、端口相同时,通过设置页面的document.domain主域,Javascript可以在不同的子域名间访问控制
可参考
http://dancewithnet.com/2007/07/22/solve-cross-sub-domain-ajax-with-document-domain/
posted on 2011-10-27 10:32 伊伦 阅读(158) 评论(0) 编辑 收藏 举报
Powered by: 博客园 Copyright © 2024 伊伦 Powered by .NET 8.0 on Kubernetes