Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support IE 8 and IE9 #259

Closed
gubagu opened this issue Apr 21, 2015 · 8 comments
Closed

Support IE 8 and IE9 #259

gubagu opened this issue Apr 21, 2015 · 8 comments

Comments

@gubagu
Copy link

gubagu commented Apr 21, 2015

Hey there,

First great routing plugin !
I am using it for a SPA that should work client side in IE8+ but i came across unsolvable problem.
The routing does not seem to work in IE8 and IE9.
In IE8 added a polyfill for add/removeEventListener and the HTML5-History-API it load the first page but the rest of the routes do not trigger page.js at all and it render a blank url does not exist browser page.
In IE9 with HTML5-History-API every time i try to navigate to another route it adds the hash tag (and it is supposed to) but because of that the urls render page not found. The whole SPA is client side. I am serving it with nginx.
Has anyone came across this problem? Any help highly appreciated. Thanks in advance !

Cheerz,
Guby

@74io
Copy link

74io commented Apr 21, 2015

Me neither. Can't get it to work in IE9. Any pointers or tips as to how the latest released has changed and which polyfills are required? I hope so as its an excellent router.

Can I just clarify whether you need to change all your hrefs to e.g. href="#mypage' to get page.js to work with browsers that do not support pushState. By setting the history object to history.redirect("", "/my_nested_folder"); and using hashbangs I can get it to work. But this means browser detecting before creating my HTML linking system.

@gubagu
Copy link
Author

gubagu commented Apr 21, 2015

I tested also the example pages with HTML5-History-API under IE9 also do not work. Did something change? Because the page.js is supposed to support IE8+ ?
By the way IE8 does not have addEventListener nor removeEventListener page.js is relying on.
Is that new ?

@amitava82
Copy link

Same issue here. It triggers "*" route handler

Edit: I found my issue with IE9. Apparently there is a bug in IE 9 where it removed leading slash from pathname there by failing regex match.

https://github.com/visionmedia/page.js/blob/master/page.js#L580

I've monkey patched pagejs to add leading slash if missing and it seems to be working.

@A A added the help wanted label Apr 24, 2015
@paulocoghi
Copy link
Contributor

You probably have already done this, but just to be sure, did you create the .htaccess file (and in case of nginx the correspondent config rule)?

<ifModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !index
    RewriteRule (.*) index.html [L]
</ifModule>

@tjyrkinen
Copy link

@amitava82 Thanks a lot! Went the monkey-patch route on it for a quick fix and saved hours of debugging time there. Fixed navigation issues on IE9 for me for now.

@bressain
Copy link

+1
Looked at #288 and after applying the changes locally, it fixed the issue for me. Would like to see it merged.

@jliuhtonen
Copy link

It is no use adding html5-history-api polyfill. This issue breaks compatibility with IE9, because it does not provide the initial slash in .pathname. Please merge.

@matthewp
Copy link
Collaborator

matthewp commented Oct 2, 2018

I'm going to close, as far as I know these browsers are still supported. Maybe someone fixed it without updating this issue.

@matthewp matthewp closed this as completed Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants