home *** CD-ROM | disk | FTP | other *** search
/ ftp.swcp.com / ftp.swcp.com.zip / ftp.swcp.com / mac / mozilla-mac-0.9.sea.hqx / mozilla-mac-0.9 / res / samples / onerror.js < prev    next >
Text File  |  2001-05-05  |  721b  |  20 lines

  1. function onerror(msg, URL, lineNum) {
  2. var errWind = window.open("","errors","HEIGHT=270,WIDTH=400");
  3. var wintxt = "<HTML><BODY BGCOLOR=RED>";
  4. wintxt += "<B>An error has occurred on this page.</B>";
  5.  
  6. wintxt += "<FORM METHOD=POST ENCTYPE='text-plain'>";
  7.  
  8. wintxt += "<TEXTAREA COLS=45 ROWS=8 WRAP=VIRTUAL>";
  9. wintxt += "Error: " + msg + "\n";
  10. wintxt += "URL: " + URL + "\n";
  11. wintxt += "Line: " + lineNum + "\n";
  12. wintxt += "Client: " + navigator.userAgent + "\n";
  13. wintxt += "-----------------------------------------\n";
  14. wintxt += "</TEXTAREA><P>";
  15. wintxt += "<INPUT TYPE=button VALUE='Close' onClick='self.close()'>";
  16. wintxt += "</FORM></BODY></HTML>";
  17. errWind.document.write(wintxt);
  18. errWind.document.close();
  19. return true;
  20. }