5

I was about to ask a question about a JSFiddle, and I noticed that the images (which I've got on Imgur) don't show up. If I load the image directly in the browser, and then reload the fiddle the picture shows up, but if you haven't already loaded the pictures they won't display. Is there a way I can fix this? Or do I just need to host the pictures on a different site?

Here's the link to the fiddle: http://jsfiddle.net/r4crr/3/

And here's a bit of dumb code from the fiddle that it appears is actually irrelevant.

<div id="makeJSFshowPics">
<img src="http://i.imgur.com/7ftvzYB.png" alt="High Interest"><img src="http://i.imgur.com/u8i9Coo.png" alt="Okay I guess"><img src="http://i.imgur.com/v66NbIR.png" alt="Do Not Want">   

aslum
  • 10,651
  • 15
  • 45
  • 67

2 Answers2

0

Opened up Chrome's network panel and noticed that those urls were getting 403 - Forbidden from imgur. Not sure why. So I opened the imgur url in a new tab, then went back to jsfiddle and hit run. Bingo, the image showed up. Had to do this for all of the images, which is not great. Looks like other people have run into this problem but there wasn't any solution to it.

jcollum
  • 36,681
  • 46
  • 162
  • 279
  • So yeah... that's basically exactly what I said the problem was. -1 – aslum Mar 13 '13 at 21:22
  • Did you mention "403 - Forbidden"? No, you didn't. Way to encourage people to help you. – jcollum Mar 13 '13 at 23:52
  • It's not so much a matter of encouraging people, as trying to get a good answer. Mentioning the 403 in a comment... I'd probably have +1ed that. It's helpful information sure. However your answer isn't actually an answer. – aslum Mar 14 '13 at 05:06
  • "Looks like other people have run into this problem but there wasn't any solution to it" and "those urls were getting 403 - Forbidden" ... in short I don't think you'll find an answer to this. Imgur might be blocking it; people brought this up on imgurs uservoice. – jcollum Mar 14 '13 at 05:20
  • Doubt this will help but: http://imgur.userecho.com/topic/120841-403-forbidden-on-jsfiddlenet/ – jcollum Mar 14 '13 at 05:23
0

For whatever reason, imgur is blocking the images from jsfiddle (and jsbin). Perhaps there were abuses coming in, I am not sure as to the why. The images are blocked based on the referrer. It would be possible to implement a bypass where the images were proloaded in an iframe which spoofed the referrer. That seems a little over the top though. It would work for the same reason that you can see the images in the fiddle after you visit the imgur url for the image, because it is cached.

Travis J
  • 77,009
  • 39
  • 185
  • 250