Skip to content
This repository has been archived by the owner on Jul 28, 2018. It is now read-only.

IE 9 compatibility #526

Open
Thibaut opened this issue May 10, 2015 · 4 comments
Open

IE 9 compatibility #526

Thibaut opened this issue May 10, 2015 · 4 comments

Comments

@Thibaut
Copy link
Collaborator

Thibaut commented May 10, 2015

We currently have no fallback for Turbolinks.replace() / render foo, change: :bar when the browser doesn't support Turbolinks / pushState.

I spent all morning trying to make the tests for that function pass in IE 9 but couldn't find a way to reliably parse a full HTML document.

  • If we parse the string with ActiveXObject, transferring nodes with adoptNode doesn't work.
  • If we parse the string with documentElement.cloneNode like we do now, we can't parse the <head>, nor the attributes on the <body>. innerHTML = doesn't work on the document, body and head.

In the end I just pushed some changes that made replace() work when passing an HTML fragment and a change option, but I don't feel confident this won't break in the wild.

Are we cool with Turbolinks.replace() not working in IE 9 and lower? If so I think we should make that function raise an error when Turbolinks is disabled (+ update the docs of course).

cc @dhh @reed

@amnesia7
Copy link

Have you had a look at wiselinks gem (https://github.com/igor-alexandrov/wiselinks/blob/master/lib/assets/javascripts/_dom_parser.js.coffee) to see if that does it any different because that has worked (off and on) back to IE8 using different functions depending on support for various things.

@Thibaut
Copy link
Collaborator Author

Thibaut commented May 18, 2015

@amnesia7 Yes, I tried it all. Couldn't make all the things work.

@amnesia7
Copy link

Maybe @aishek (I saw a PR about fixing wiselinks for IE8) or @igor-alexandrov might be able to offer any suggestions about this issue since wiselinks allows replacing portions of the html?

@tortuetorche
Copy link

I've done an experimental shim for IE 8 and 9 to support the Turbolinks.replace() method of Turbolinks 3, you can grab the code here.
It isn't ready for production-ready yet, but the basic features are OK.
You can see an online demo here, which is built with the PHP framework Laravel.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants