function logError( errorMsg, url, lineNumber ) { // TODO: onerror isn't part of any spec, so different browsers implement // it differently. is there an abstraction layer in Prototype we can use? new Ajax.Request( "/ajax/log_js_error.php5", { method: "post", postBody: "errorMsg=" + errorMsg + "&url=" + url + "&lineNumber=" + lineNumber } ); return false; } /** * Open a popup window containing the specified help file * @param string filename * @return void */ function openHelp( filename ) { window.open( filename, 'help_popup', 'width=250, height=150, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no' ); } Event.observe( window, "error", logError );