问题描述
我几乎不可能解决问题,但我希望有人可以提出一些可行的解决方案或解决方法.
I have almost impossible problem, but I am hoping someone could come up with some working solution or workaround.
我有一个网站,我在其中使用 History.js 进行按需更改页面防止在单击链接时加载整个页面.但是我的网站有多个域,因此跨域策略不允许使用主机更改完整URL,只能更改/设置相对路径.
I have a website where I use History.js to do on-demand page changes to prevent loading full page when clicking on links. My website however has multiple domains, so cross-domain policy doesn't allow change full URL with host, only relative path can be changed/set.
任何人都可以帮助我,如何利用History.js并克服跨域策略?但是,我不能停止使用这些多个域,因此单个域不是解决方案.
Can anyone help me, how to make use of History.js and overcome cross-domain policy ? However, I can't stop using those multiple domains, so single domain is not solution.
在此先感谢您的帮助.
推荐答案
出于安全原因,这是不可能的.允许跨域pushState将允许恶意域伪装成受信任的域.
That's not possible for a security reason. Allowing cross-domain pushState would allow malicious domains to masquerade as a trusted one.
这篇关于是否可以在多个域中使用HTML5的pushState()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!