Is it possible to detect an HTTP 302 (Moved) response during an image load from JavaScript?
We’re using a simple DART ad banner image that does a request-redirect to show the actual creative. The src of the image points to the DART server, but if you inspect the request-response communication, you can see the redirect happening:
curl -LI "http://ad.doubleclick.net/ad/mycompany.com/main;sz=320x50;ord=9524078512356?"
HTTP/1.1 302 Moved Temporarily
Content-Length: 0
Location: http://s0.2mdn.net/viewad/12345678/actual_creative.jpg
Content-Type: text/html
HTTP/1.1 200 OK
Content-Type: image/jpeg
Content-Length: 6811
In the end, I want to be able to detect the string actual_creative.jpg. This only needs to work in Mobile Safari, so I’m hoping there is an event listener I can use to monitor the load at a very low level.
It is not possible to get the redirect location url using JavaScript.