What's the proper way to load an image using ajax?
I cannot use the usual <img/>
tag as I have to pass some specific http headers to the GET
request. For that reason, I'm somewhat limited to using Ajax. The headers that I have to pass to the request are credentials. Without that, it won't be possible to get the image files.
I was wondering if there was a way to make an ajax request to load the data into the img
tag and still keep the src
attribute as the real url of the image. I'm not too much interested into loading the image using a base64 data url.