Is it possible to use HTML5's pushState() across multiple domains?

烂漫一生 提交于 2019-12-12 09:45:25

问题


I have almost impossible problem, but I am hoping someone could come up with some working solution or workaround.

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.

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.

Thanks in advance for any help.


回答1:


That's not possible for a security reason. Allowing cross-domain pushState would allow malicious domains to masquerade as a trusted one.



来源:https://stackoverflow.com/questions/8507641/is-it-possible-to-use-html5s-pushstate-across-multiple-domains

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!