Images detection with Microsoft explorer

They have: 24 posts

Joined: Jun 2000

I have an HTML file with an advertiser javascript tag inserting a banner in it.
I want to detect the name of the image file sent by the advertiser. The purpose is to detect the default banner when sent in order to redirect to another provider.

I used the following js code working fine with Netscape but with I Explorer I don't get any result at all (and no error msg too):

_imgcount=top.banner.document.images.length;
_imgsource=" ";
_found=-1;
for(i=0;i<_imgcount;i++)
{
_imgsource=top.banner.document.images[i].src;
if(_imgsource.search("flash-es.gif")!=-1)
{alert("FOUND flash-es.gif")}
}

Explorer is not able to detect any images sent by my banner provider with this code...
If you ever need more details to understand the problem, please contact me.
Any ideas?

Thanks to all.

The web design reference for spanish readers
http://www.flash-es.net
500,000 impressions a month
El límite esta en tu imaginación

They have: 24 posts

Joined: Jun 2000

By testing the code sent by the banner provider,
it seems that the banner image is embedded into an IFRAME
tag. Explorer detects the frames but when trying to get back
info on it with for instance a self.frames[i].document.images.length I get back an "access denied" response.
How can I just get this image.src value?

The web design reference for spanish readers
http://www.flash-es.net
500,000 impressions a month
El límite esta en tu imaginación

detox's picture

They have: 571 posts

Joined: Feb 2001

Will get on that now.

Intend to look up the dom model for IE and try to reply soon,
Cheers

... don't give up hope, we'll get there!

detox's picture

They have: 571 posts

Joined: Feb 2001

Just received 1 answer:

Quote: Try switching this line:
if(_imgsource.search("flash-es.gif")!=-1)

With this:

if(_imgsource.indexOf("flash-es.gif")!=-1)

OTHERWISE

try looking here, if you dig long enough, you can usually find the answer:

http://msdn.microsoft.com/workshop/author/dhtml/reference/collections/attributes.asp

and

msdn.microsoft.com/workshop/browser/mshtml/reference/IFaces/Document2/get_images.asp

by the way, have posted questions with colleagues etc, will hopefull get an answer soon.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.