The browser should not make an attempt to execute code received via an img tag as JavaScript. The script would be delivered to the browser, but in its place would be a broken image that could not be displayed.
Up vote 3 down vote favorite 2 share g+ share fb share tw.
I would like to know if it is possible to inject some javascript code through an img-tag. The scenario is that one sets up a html-page like this Anotherdomain is my domain. Is it possible to redirect the call for /someimage.
Jpg to another file containing som javascript code that is executed when the image is requested? Javascript html img javascript-injection link|improve this question asked Nov 26 '11 at 20:06Mathias Bak43219 100% accept rate.
Not sure why this was downvoted. It is a reasonable question and not one that the answer could be easily found by an Internet search. – Michael Nov 26 '11 at 20:11.
The browser should not make an attempt to execute code received via an tag as JavaScript. The script would be delivered to the browser, but in its place would be a broken image that could not be displayed. Browsers will only execute scripts received in a tag or onclick,onmouseover,onmouseout,etc... attributes as a basic security principle.
– Mathias Bak Nov 26 '11 at 20:11 1 @MathiasBak Pretty much - or send a file that is very big, eating the client's (and origin server's) bandwidth. – Michael Nov 26 '11 at 20:13 Thank you for the tip. – Mathias Bak Nov 26 '11 at 20:15.
No, all major browser will not accept javascript code at this point.
No. The problem (if you want to call it that) is that the URL in question is interpreted as image data, not as a JS script. So regardless of what it is or how it's redirected, it's not going to get evaluated as JS.
Note: tags work cross-domain, so you should probably just use that.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.