So now we have a common code to report errors either from our code or from third-party code. Our project is the JQM / Phonegap project for iOS. What happens, we almost always get the same useless error ... TypeError: 'undefined' is not a function ... without a line number or other useful information. Is there a way to change the code, maybe get WHAT undefined or WHERE?
window.onerror = function myErrorHandler(errorMsg, url, lineNumber) { //Handle errors not in a jquery event handler //DebugMessage(errorMSg + " "+ url + " " + lineNumber); var ex = new Error(errorMsg, url, lineNumber); HandleError(ex, "window.onerror"); //HandleError sends the error object to //a webservice to log the error. return true; };
Any tips for debugging javascript errors will also help.
javascript jquery-mobile ios error-handling cordova
Twomz
source share