How can you have the img's src attribute point to a web page itself instead of an image?

Consider the strange case of this reddit preview page for example:

https://preview.redd.it/uhomipyb8kp71.jpg?width=575&auto=webp&v=enabled&s=b0e044ddd8a83774e0453cb7607ef681444c4c37

If you inspect the primary <img> element on the page, you’ll find its src attribute not pointing to any image file but (behold!) that link itself!

Through this mechanism, they’ve effectively hidden the direct link to that image, isn’t it? How is this even possible? Is this a new phenomenon or way in web development?

The link to the image starts with this:

https://preview.redd.it/uhomipyb8kp71.jpg

The URL then includes some other parameters after the ?. That string of values and parameters after the ? is called a query string.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.