Phiên bản đầy đủ: jsB@nk » Linh tinh » Thông báo lỗi
URL: https://www.javascriptbank.com/error-report.html
Đoạn mã sẽ kiểm tra và đưa ra thông báo lỗi cho người dùng.
Phiên bản đầy đủ: jsB@nk » Linh tinh » Thông báo lỗi
URL: https://www.javascriptbank.com/error-report.html
<style type=text/css><!--.small { font-size: .7em; color: red; background: inherit;}--></style><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<script type="text/javascript">// Created by: Iiro Krankka :: http://www.taikasilma.com/function hiderror() { document.getElementById('err').innerHTML=""}function errorCode() { document.write("<span id='err' onclick='hiderror()'></span>"); window.onerror=Error; function Error(msg,url,l) { error="<strong>A Javascript error has occured!<br>" error+="____________________________________________________<br><br>" error+="Error message: " + msg + ".<br>" error+="URL: " + url + "<br>" error+="Line: " + l + "<br>" error+="____________________________________________________<br></strong>" error+="<span onmouseover='hiderror()' class='small'>[mouseOver here to hide error message]</span>" document.getElementById('err').innerHTML= error; self.scroll(0,0); }}// --></script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<table width="50%" align="center"><tr><td><div id="all"><!-- Place the line of code shown below on the page where you want the error message to be displayed. --><script type="text/javascript">errorCode();</script><br><br><b>An example:</b><input type="button" value="Free coke!" onclick="abbbblertti('ddd');"></div></td></tr></table><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->