Reputation: 23
I have a tracking pixel img like this one:
<img ... width=1 height=1 src="http://trk.dom123.com/file.aspx?type=1&cp=1" />
I would like to be able to return a javascript from this src. This will then use me to make the analysis I am required to do.
Meaning calling the IMG src will result with a script I generate in my server, injected to the page that fired the pixel (the IMG tga).
Is it possible? if not please suggest any other alternatives.
Many thanks.
Upvotes: 0
Views: 573
Reputation: 66388
Not possible, alternative would be:
<script type="text/javascript" src="http://trk.dom123.com/file.aspx?type=1&cp=1"></script>
Upvotes: 0
Reputation: 91497
No, an img
tag will not process javascript. It will result in a broken image. The obvious answer is to simply do:
<script type="text/javascript" src="http://trk.dom123.com/file.aspx?type=1&cp=1"></script>
Upvotes: 1
Reputation: 2886
It's not possible with modern browsers due to XSS attacks. You will have to include any javascript with a <script>
tag
See http://ha.ckers.org/xss.html
Upvotes: 2