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

📄 jitk-error.js

📁 esri的ArcGIS Server超级学习模板程序(for java)
💻 JS
字号:
/*
COPYRIGHT 1995-2005 ESRI

TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
Unpublished material - all rights reserved under the 
Copyright Laws of the United States.

For additional information, contact:
Environmental Systems Research Institute, Inc.
Attn: Contracts Dept
380 New York Street
Redlands, California, USA 92373

email: contracts@esri.com
*/


function addErrorPostBackHandler () {
	EsriControls.addPostBackTagHandler("jitk-errors", errorHandler);
}

function errorHandler(xml, eventSources) {
	var errorNL = xml.getElementsByTagName("jitk-error");
	
	// create the error array
	var errors = new Array();
	var messageType = "";
	
	for(i=0; i < errorNL.length; i++) {
		errorNode = errorNL.item(i);
		if (errorNode.getAttribute("code") != null) {
			messageType = errorNode.getAttribute("code");
		}
		errors[i] = errorNode.firstChild.nodeValue;
	}
	
	// hide the loading indicator on the map
	for(i=0; i < EsriControls.maps.length; i++) {
		EsriControls.maps[i].hideLoading();
	}
	
	// find the corresponding taskwindow and populate message element
	var hasTaskErrorMsg = false;
	if(taskWindowManager) {
		var win = taskWindowManager.windows["win_EsriTaskCell_" + eventSources];
		if(win != null) {
			switch(messageType) {
				case "info":
					win.info(errors);
					break;
				case "success":
					win.success(errors);
					break;
				case "question":
					win.question(errors);
					break;
				case "warning":
					win.warning(errors);
					break;
				default:
					win.error(errors);
					break;
			}
			hasTaskErrorMsg = true;
			win.hasError = true;
		}
	}

	// fall-back for the case that the error could not be shown in the taskwindow
	if (!hasTaskErrorMsg) {
		var errorStr = "";
		for(i = 0; i < errorNL.length; i++) {
			errorNode = errorNL.item(i);
			if (errorNL.length > 1) {
				errorStr += "- ";
			}
			errorStr += errorNode.firstChild.nodeValue;
			errorStr += "\n";
		}
		alert(errorStr);
	}
}

⌨️ 快捷键说明

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