turbolinks / turbolinks-classic

Classic version of Turbolinks. Now deprecated in favor of Turbolinks 5.
MIT License
3.54k stars 428 forks source link

Turbolinks.visit, partial replacement & relative urls (& IE11) #655

Open 10io opened 8 years ago

10io commented 8 years ago

Hello!

I'm using Turbolinks.visit manually with partial replacement. Here is an example of such call:

Turbolinks.visit('/update', { 'change': 'content' })

On Chrome, FF and Safari, it works as expected. On IE11, a full replacement is done instead of a partial one.

If I use an absolute url:

Turbolinks.visit('http://172.22.22.54:4001/update', { 'change': 'content' })

it works correctly on IE11.

Hence my question, is Turbolinks.visit intended to be only used with absolute urls? If so, the readme could be updated: there are some Turbolinks.visit usage examples with relative urls.

After some digging, it seems that this line (crossOrigin function in ComponentUrl) is the issue: