Kre*_*dns 3 html javascript jquery cross-domain
我有一个网站,我的域名是通过网络解决方案注册的(我不推荐).我正在使用他们的Web转发功能,它允许我"掩盖"我的域名,以便当用户访问http://lucasmccoy.com时,他们实际上通过HTML框架看到http://lucasmccoy.comlu.com/.这样做的好处是地址栏仍然显示http://lucasmccoy.com/.
缺点是我不能直接编辑拥有框架的HTML页面.例如,我无法更改页面标题或favicon.我试过这样做:
$(function() {
parent.document.title = 'Lucas McCoy';
});
Run Code Online (Sandbox Code Playgroud)
但是当然这会给我一个JavaScript错误:
Unsafe JavaScript attempt to access frame with URL http://lucasmccoy.com/ from frame with URL http://lucasmccoy.comlu.com/. Domains, protocols and ports must match.
我看着这个问题尝试做同样的事情,除了OP可以访问其他页面HTML,而我没有.
当你无法访问该域时,JavaScript/jQuery中是否存在向DOM发出跨域请求?或者这是因为出于安全原因,浏览器不会发生这种情况.
| 归档时间: |
|
| 查看次数: |
1368 次 |
| 最近记录: |