-1

I am trying to display an image (gravatar), but the ampersand in its link seem to be problematic.

At first, I had:

<!doctype html>
<html lang="fr">
<head>
    <meta charset="utf-8">
    <title>&amp; in url</title>
</head>
<body>
    <a href="http://www.gravatar.com/avatar/f14e8ce12e7d7ffc11fe8a29127030da.jpg?d=mm&r=r">Link to image</a>
    <img src="http://www.gravatar.com/avatar/f14e8ce12e7d7ffc11fe8a29127030da.jpg?d=mm&r=r" alt="display image">
</body>
</html>

The link (<a>) works fine this way, but the image (<img>) won't show. And of course it doesn't pass the w3c validation.

I encoded the ampersand to &amp;, but the result stays the same (except for the w3c validation which is OK). I even tried a urlencoded version (via PHP) with no luck.

Any idea on what I am missing?

Edit: Nothing to do with encoding, this time. Ghostery (Firefox addon for privacy) was blocking gravatar images... Sorry guys and thanks for your help.

Yosko
  • 187
  • 1
  • 3
  • 12
  • 2
    Works fine [here](http://jsfiddle.net/UNc4m/). Does this fiddle work four you, too? Then the problem must be somewhere else. – insertusernamehere Oct 02 '13 at 09:16
  • 1
    You're right! I still don't see the gravatars in the fiddle, nor anywhere else like I used to last week (unless I display it directly). Maybe something has changed in my browser or proxy... This means my code is correct. I'll investigate on the problem. Thanks – Yosko Oct 02 '13 at 09:21
  • yes, that's working. check this http://jsfiddle.net/42gz7/ – Debashis Oct 02 '13 at 09:23
  • Yeah. It clearly is my Firefox's fault. Apparently, it doesn't even try to load the image (I checked through the developer tool's web console). And the display works in IE... – Yosko Oct 02 '13 at 09:37

1 Answers1

0

Your image is not dependent on URL parameters and it even works without any get parameters.

As It is mentioned in the comments, your problem is not with the URL, but with loading the content.

Moradnejad
  • 2,622
  • 1
  • 23
  • 50