Although IE4/NS4 don't support try/catch functionality, they do have those names as reserved keywords. Clearly they were planning to support it.
If you have a block of JS with try/catch anywhere within it, even if the code isn't executed by IE4/NS4 due to logic/sniffing, it still causes a problem with the parser. The error is something like "try is a reserved keyword".
I wondered if anyone had made some kind of workaround that allows them to use try/catch in these browsers without having to resort to using eval. I have the occasional use in that way, like this:
but that's not so easy when the something dangerous is a lot of code.
Anyone else worked around this in another way?
~dd
If you have a block of JS with try/catch anywhere within it, even if the code isn't executed by IE4/NS4 due to logic/sniffing, it still causes a problem with the parser. The error is something like "try is a reserved keyword".
I wondered if anyone had made some kind of workaround that allows them to use try/catch in these browsers without having to resort to using eval. I have the occasional use in that way, like this:
Code:
if(!V4Browser)
eval("try{something dangerous;}catch(e){}");
but that's not so easy when the something dangerous is a lot of code.
Anyone else worked around this in another way?
~dd