turbolinks / turbolinks-classic

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

img tags with external URL load, but also trigger a 404 error #597

Closed lewispb closed 6 years ago

lewispb commented 9 years ago

When using Turbolinks.replace within my javascript, I load a page that has an image tag

<img src='https://i.scdn.co/image/e6e0f9445f0a0cc894925941b0630990364c9f7a'>

Which does work as intended, but I also get the following error in the console:

 //localhost:3000/'https://i.scdn.co/image/e6e0f9445f0a0cc894925941b0630990364c9f7a/' 404 (Not Found)

Interestingly, this works with no error (notice, no quotes):

<img src=https://i.scdn.co/image/e6e0f9445f0a0cc894925941b0630990364c9f7a>

This also affects images using image_tag.

Thibaut commented 9 years ago

I can't reproduce this. Could you make an example app that exhibits the bug?

lewispb commented 9 years ago

https://github.com/lewispb/turbolinks-img-example

Refer to the partial: _test.html.haml

I believe it was because my partial lacked the same div as was referred to in my javascript. Maybe this issue just needs a better error message.