Prev: [SOLVED] Do not assign undefined to window.onerror in IE/MSHTML (was: Trigger hover pseudo class using javascript?)
Next: Transposing X and Y coord from child to parent
From: Thomas 'PointedEars' Lahn on 28 Apr 2010 09:49 Thomas 'PointedEars' Lahn wrote: > [...] Although I am setting a default value if `fError' is (supposedly) > not a method, _fHandler_ > the newly introduced closure and namespaces change everything as > jsx.clearErrorHandler() is not yet defined when setErrorHandler() is being > defined. > > var setErrorHandler = jsx.setErrorHandler = (function () { > var > jsx_object = jsx.object, > jsx_clearErrorHandler = jsx.clearErrorHandler; > > return function (fHandler) { > // ... > > if (!jsx_object.isMethod(fHandler)) > { > fHandler = jsx_clearErrorHandler; > } > > if (typeof window != "undefined" > && typeof window.onerror != "undefined") > { > // ... > window.onerror = fHandler; > } > > return (typeof window.onerror != "undefined" > && window.onerror == fHandler); > }; > }()); > > var clearErrorHandler = jsx.clearErrorHandler = function () { > // ... > }; -- PointedEars
From: Andrew Poulos on 28 Apr 2010 18:23
On 28/04/2010 11:18 PM, Thomas 'PointedEars' Lahn wrote: > Jake Jarvis wrote: > >> On 28.04.2010 13:43, wrote Thomas 'PointedEars' Lahn: >>> Andrew Poulos wrote: >>>> [http://PointedEars.de/es-matrix] >>>> IE 8 on Vista warns that >>> [...] >>>> Not implemented >>>> object.js, line 308 character 7 >>> >>> Thank you. Apparently there is a problem with >>> >>> | if (typeof window != "undefined"&& typeof window.onerror != >>> | "undefined") >>> | { >>> | window.onerror = fHandler; >>> ^ >>> | } >>> >>> that the feature test could not deal with. >>> >>> I am using this as a fallback mechanism for exceptions in >>> jsx.setErrorHandler(). Since this method is called from several others, >>> and I do not have Windows Vista to test with, could someone possibly >>> provide a stack trace, or more insight as to why the test would be passed >>> but the >>> assignment would not work, please? TIA. >> >> It's also erroring with "Nicht implementiert" (~ "not implemented") in >> Windows XP SP 3, IE 8.0.6001.18702 here. >> >> I'll try to copy the stack trace: >> >> | JScript anonymous function >> >> object.js line 308 >> >> | JScript anonymous function >> >> refers to debug.js, line 50 `setErrorHandler();` >> >> | JScript global code >> >> So it appears you can not assign undefined to window.onerror in ie8 >> >> the following [test case] also fails here > > Thank you very much! That was the reason, indeed. Although I am setting a The page doesn't give any errors in IE 8 on Vista. Andrew Poulos |