Html5历史Api - 从域到子域的pushState [英] Html5 History Api - pushState from a domain to a subdomain

查看:95
本文介绍了Html5历史Api - 从域到子域的pushState的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站作为门户网站类型的应用程序的登陆和信息页面。

I have a website as the landing and information page to a web portal type of application.

我需要链接到门户网站以引发动画美妙地过渡到门户视图(导航滑出,新的导航幻灯片,各种小部件淡出,新的淡入淡出等)。

I need the link that goes to the portal to set off an animation that beautifully transitions to the portal view (navigation slides out, new navigation slides in, various widgets fade out, new ones fade in, etc).

但是,我还需要将网址从 www.mydomain.com 转到 portal.mydomain.com

However, I also need the url to go from www.mydomain.com to portal.mydomain.com.

我愿意去任何长度同时加载门户网站和网址的动画成为子域名。

I'm willing to go to any length to have BOTH, the animation to load the portal and the url to be a subdomain.

我认为这样做会违反安全政策而不被允许,但是没有办法实现流畅的过渡到门户网站如果要重新加载。

As it stands I understand doing this would violate the security policy and not be allowed, but there is no way to achieve a fluid transition into the portal if a reload is to be had.

是否可以做任何事情?或许可以通过某种方式在两个域之间建立明确的信任。

Is there ANYTHING that can be done? Perhaps some way to establish explicit trust between the two domains.

推荐答案

无法完成。这是设计。没有例外。

It can't be done. This is by design. There are no exceptions.

来自 Mozilla pushState文档


新网址必须是与当前URL的原点相同; 否则,pushState()将抛出异常。

The new URL must be of the same origin as the current URL; otherwise, pushState() will throw an exception.

这篇关于Html5历史Api - 从域到子域的pushState的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆