View Full Version : onerror
Shecky
03-22-2003, 05:45 PM
I use adbanners on my site from compactbanner to make a little cash from my site, one of these banners prompts my users with a "script error" message about 10% of the time, and its REALLY annoying. The compact banner code uses an iframe to deliever the banners.
I was wondering is there a way to use the onerror event in regard to the iframe, or the url loaded within the iframe, simply not show the banner when their script gimps out?
Would it work with window.onerror?
would it work with iframename.onerror?
or even... iframename.src.onerror?
how do i use the onerror even in reference to a document inside an iframe?
brothercake
03-22-2003, 06:19 PM
Have you tried telling your banner provider about the error?
Shecky
03-22-2003, 06:29 PM
naw. i suppose i should. my philosphy is to fix things myself. (thats why i come to you guys with every little problem i have, ya know :p )
I just figure that when its one webmaster going 'blah blah script error' 1. my email probly wont get read, 2. they likely know about the error but the company is paying them too much for them to complain and go 'how about something a little less error-ridden. (they would really have to know about the error... its rather frequent.)
anyway i determined i can likely fix the whole matter with the onerror event, i just need to know how to refer to their page before i get started handling the error
brothercake
03-22-2003, 06:53 PM
Look at it the other way - if you were the ad provider wouldn't you want to know? Don't assume they'll be hostile just because you've experienced hostility in the past; it's much better to start from the assumption they do want to know, and see how it goes. It's the same with browsers - if you find a bug, tell the vendor; don't try and hack past it unless you absolutely have to.
If they say they don't care .. then I'd dump the slackers and go with someone else.
As for script interception across an iframe, I don't know. And to be frank - I wouldn't post the answer in a public forum if I did. Almost all of IE's major security flaws begin with cross-iframe scripting. That's no reflection on you; I just don't want that kind of knowledge more widely available.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.