3 Replies Latest reply on Sep 18, 2008 5:18 AM by Ilya Shaikovsky

    onbeforeunload "Unspecified Error" in IE6

    Chuck G Newbie


      I am writing an application for IE 6 using RichFaces (I hope this evokes SOME sympathy from all - hehe) and I am using an onbeforeunload event to trap form changes and ask the user if they really want to navigate to another page. I have the code working (albeit with some hacks, it was asking twice at first), but when the user hits cancel I get an "Unspecified Error" Javascript error. After some research, I found that this occurs when eval() is called in Javascript (and ONLY in IE6), and the solution is to surround the eval() function with a try/catch block (in Javascript). Now, I don't have access to the function call since it is part of Richfaces (or maybe just JSF in general, I am not sure).

      Has anyone run into this issue and if so, knows of a way around it. It's not a complete show stopper as show every javascript error is not enabled by default, but I'd like to not have that ugly yellow triangle come up every time a user cancels a page.

      Any help/advice is greatly appreciated.