⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 error.js

📁 论坛BBS
💻 JS
字号:
/*
##############################################
#     BigMole Dynamic Discussion Board 2.0     #
#     By Emil A Eklund (http://BigMole.5188.org/contact.html#emil)      #
#    and Erik Arvidson (http://BigMole.5188.org/contact.html#erik)     #
#              April 24, 1999                #
##############################################
# Feel free to use this script for personal  #
# and non-profit organisation's websites,    #
# as long as you're giving us credits for it #
# in other words, not removing nur modifying #
# this notice in any of the files it apperes #
##############################################
#   For comercial use contact Emil or Erik   #
##############################################

This file should probably be replaced with another
error handler once the product is out of beta
*/

window.onerror = doError;

document._error_messages = new Array();

var w;

function doError(msg,url,ln) {
	var _error_obj = new Object();
	_error_obj.msg = msg;
	_error_obj.url = url;
	_error_obj.ln = ln;
	
	document._error_messages[document._error_messages.length] = _error_obj;
	
	str = ""
	str += "<title>Error Dialogue (BigMole)</title>"
	str += "<script>window.onload=new Function('showError()');"
	str += 'var nr=0;'
	str += 'function next() {'
	str += '   nr=Math.min(window.opener.document._error_messages.length-1,nr+1);'
	str += '   showError();'
	str += '}'
	str += 'function previous() {'
	str += '   nr=Math.max(0,nr-1);'
	str += '   showError();'
	str += '}'
	str += 'function showError() {'
	str += '   errorArray = window.opener.document._error_messages;'
	str += '   if (errorArray.length != 0 && nr >= 0 && nr < errorArray.length) {'
	str += '      url.innerText = errorArray[nr].url;'
	str += '      msg.innerText = errorArray[nr].msg;'
	str += '      ln.innerText = errorArray[nr].ln;'
	str += '   }'
	str += '}</script>'
	str += "<style>"
	str += "body {background: white; color: black; border: 10 solid navy; font-family: tahoma, arial, helvitica; font-size: 12px; margin: 0;}"
	str += "p {font-family: tahoma, arial, helvitica; font-size: 12px; margin-left: 10px; margin-right: 10px;}"
	str += "h1	{font-family: arial black; font-style: italic; margin-bottom: -15; margin-left: 10; color:navy}"
	str += "button {margin: 0; border: 1 solid #dddddd; background: #eeeeee; color: black; font-family: tahoma, arial; width: 100}"
	str += "a {color: navy;}"
	str += "a:hover {color: blue;}"
	str += "</style>"
	str += '<body scroll="no">'
	str += "<h1>Oops!</h1>"
	str += '<p>An error ocurred in the file <br><strong id="url"></strong><br>This is being logged on the server.</p>'
	str += '<p style="margin-bottom: 5;">Please wait for confirmation before closing this window.</p>'
	str += '<table style="width: 100%;" cellspacing=0 cellpadding=10><tr><td>'
	str += '<button onclick=\'if (infoArea.style.display!="block") {infoArea.style.display = "block";window.resizeTo(400,308);this.innerText="Hide Error";}else {infoArea.style.display="none";window.resizeTo(400,219);this.innerText="Show Error";}\''
	str += 'onmouseover="this.style.borderColor=\'black\'" onmouseout="this.style.borderColor=\'#dddddd\'">Show Error</button>'
	str += '</td><td align="RIGHT"><button onclick="window.close()" onmouseover="this.style.borderColor=\'black\'" onmouseout="this.style.borderColor=\'#dddddd\'">Ok</button>'
	str += '</td></tr></table>'
	str += '<div id="infoArea" style="display: none;">'
	str += '<div id="info" style="background: #eeeeee; margin: 10; margin-bottom: 0; border: 1 solid #dddddd;">'
	str += '<table>'
	str += '<tr><td><p>Message:</p></td><td><p id="msg"></p></td></tr>'
	str += '<tr><td><p>Line:</p></td><td><p id="ln"></p></td></tr>'
	str += '</table>'
	str += '</div>'
	str += '<table style="width: 100%;" cellspacing=0 cellpadding=10><tr><td>'
	str += '<button onclick="previous()" onmouseover="this.style.borderColor=\'black\'" onmouseout="this.style.borderColor=\'#dddddd\'">Previous</button>'
	str += '</td><td align=right><button onclick="next()" onmouseover="this.style.borderColor=\'black\'" onmouseout="this.style.borderColor=\'#dddddd\'">Next</button>'
	str += '</td></tr></table>'
	str += '</div>'

	str += '<iframe style="display: none;" src="' + cgiFile + '?action=error&url=' + _error_obj.url + '&line=' + _error_obj.ln + '&error=' + _error_obj.msg + '"></iframe>';

	str += '</body>'

	if (!w || w.closed) {
		w = window.open("","_webxf_error_win","width=390,height=190");
		var d = w.document;
		d.open();
		d.write(str);
		d.close();
		w.focus();
	}
	return true;
}




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -