给定连接查询ems配送信息

<script type="text/javascript">
	//http://localhost:8080/testJs/tocarrier.jsp?deliveryid=ZJ534991422DS&carrierid=1000031
	//http://www.11183.com.cn/emsService/ems/order/singleQuery_t
	//http://wms.best1.com/wms/tocarrier.jsp?deliveryid=ZJ535943233DS&carrierid=1000031
	var str = window.location.href;
	if ((str.indexOf('tocarrier.jsp\?deliveryid\=') == -1)
			|| ((str.indexOf('\&carrierid\=')) == -1)) {
		alert('Sorry....地址有错误 ');
		window.opener = null;
		window.close();
	} else {
		var strs = (str.split('\?')[1]).split('&');
		var deliveryid = strs[0].split('=')[1];
		var carrierid = strs[1].split('=')[1];
		if (('' == deliveryid) || ('' == carrierid)) {
			alert('Sorry....请带有配送单号和货运公司编号 ');
			window.opener = null;
			window.close();
		} else {
			if (carrierid == '1000031') {
				//window
					//	.open("http://www.ems.com.cn/qcgzOutQueryNewAction.do?reqCode=gotoSearch&mailNum="
						//		+ deliveryid);
				window.open("tocarriertoems.jsp?mailNum="+ deliveryid);
				window.opener = null;
				window.close();
			} else {
				alert('Sorry....现在只能查看邮政的');
				window.opener = null;
				window.close();
			}
		}

	}
</script>


tocarriertoems.jsp
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

</head>
<!--  <body onload="form1.submit() ">    http://www.ems.com.cn/emsService/ems/order/singleQuery_t-->
<body onload="toems()">
<form action="http://www.11183.com.cn/ems/order/singleQuery_t "
	id="singleform" method="post" name="form1"><input
	id="mailnum_input" name="mailNum" type="text" value="" />
<input type="submit" value=""></form>
<script type="text/javascript">
	var str = window.location.href;
	var deliveryid = (str.split('\?')[1]).split('=')[1];
	//document.form1[mailnum_input].value = deliveryid;
	function getDeliveryid() {
		var str = window.location.href;
		return (str.split('\?')[1]).split('=')[1];
	}
	function toems() {
		document.getElementById('mailnum_input').value = getDeliveryid();
		document.getElementById('singleform').submit();
	}
</script>


</body>
</html>

你可能感兴趣的:(查询)