简体   繁体   中英

Why do certain redirects cause Nexus Chrome browser to not run Javascript?

On the Chrome 18.0.1025469 browser for Nexus 7, 4.2.2. certain redirects seem to cause Javascript not to load.

For example the following page: http://jsfiddle.net/NTEQF/show/ has the javascript

alert(1)

On my nexus I see the the alert if I type in the following:

jsfiddle.net/NTEQF/show/

But if I type in (with a clear cache)

www.jsfiddle.net/NTEQF/show/

I can see the url redirect to jsfiddle.net/NTEQF/show/ but I see no alert.

Once I visit the page a few times, the alert starts to show up. To reproduce the no alert consistently, I can clear all the data through the devices setting panel: Apps > All > Chrome > Clear Data - Sometime clearing the cache through the privacy settings within Chrome does the trick too.

This means that there are situations where pages can load as if you have Javascript disabled when it is enabled. Any ideas as to what causes this or how to fix it aside from not using redirects? I have seen the issue both on redirects that remove and add www .

You must be consistent with redirects.

If you call www.whateverpage.com on one redirect and then just whateverpage.com on another, you are actually going to two different domains, so any cookies or session cookies might be set for one domain but not the other. This is true also if you have for example a page like mobile.whateverpage.com . These are all different domains, so you'll have to treat them accordingly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM