I'm building a litle GIS application using JavaScript (beginning to
think I'm a masochist!)
Most things work fine in NS4.5 and IE4/5 but I have sparsely populated
the database the app draws its data (images and attributes from).
Basically, the app will attempt to load a particular image or html - if
it's not there that should NOT be an error
NS seems happy to ignore the lack of a file but IE5 presents this
helpful but annoying page saying "The page cannot be displayed" and
offering all sorts of help - and completely destroying (replacing) my
app along the way!
Does any one know of a way to stop the error. It occurs during:
document.all.tags("IFRAME").item(0).src=path;
where path is a tring giving the path to the document that might not
exist. I have to load the document into the IFRAME in IE as you can't
load an external URL into a DIV in IE (can in NS). I've tried:
1. document.all.tags("IFRAME").item(0).onerror=ignoreError;
where ignoreError is a null function (does nothing)
2. try {
document.all.tags("IFRAME").item(0).onerror=ignoreError;
document.all.tags("IFRAME").item(0).src=path;
}
catch (exception) {
alert("Error: "+Error.number+" "+Error.description);
return true;
}
3. window.onerror=ignoreError
but it still seems to cause the error before any of my error handlers
are invoked
All help appreciated and thanks in advance
Peter
--
Martin Honnen
mailto: Martin...@sector27.de
http://www.sector27.de/martin.honnen
Thanks for the suggestion - but I've already tried it (just tried it again)
and it doesn't work
It seems the error is handled deep down in Explorer before it ever gets close
to user-definable error-handlers
Regards