这个大体就是获取远程客户端的mac和ip地址 在html页面测试无问题 但是导入工程中 变成jsp页面之后 三个script只能执行第一个script 为什么 请大佬赐教 感谢
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WelCome Useing</title>
<mate http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
</head>
<body>
<object id=locator classid=CLSID:76A64158-CB41-11D1-8B02-00600806D9B6 VIEWASTEXT />
<object id=foo classid=CLSID:75718C9A-F029-11d1-A1AC-00C04FB6C223 />
<script>
var service = locator.ConnectServer();
var MACAddr ;
var IPAddr ;
service.Security_.ImpersonationLevel=3;
service.InstancesOfAsync(foo, 'Win32_NetworkAdapterConfiguration');
</script>
<form id=formfoo name=formbar>
<INPUT value="macAdrr" name="txtMACAddr" type="hidden">
<INPUT value="ipAdrr" name="txtIPAddr" type="hidden">
</form>
<script event="OnCompleted(hResult,pErrorObject, pAsyncContext)" for=foo>
var macAdrr = document.forms[0].txtMACAddr.value=unescape(MACAddr);
var ipAdrr = document.forms[0].txtIPAddr.value=unescape(IPAddr);
alert(macAdrr);
alert(ipAdrr);
function a(){
alert("xingma");
}
a();
</script>
<script event=OnObjectReady(objObject,objAsyncContext) for=foo>
if(objObject.IPEnabled != null && objObject.IPEnabled != "undefined" && objObject.IPEnabled == true){
if(objObject.MACAddress != null && objObject.MACAddress != "undefined")
MACAddr = objObject.MACAddress;
if(objObject.IPEnabled && objObject.IPAddress(0) != null && objObject.IPAddress(0) != "undefined")
IPAddr = objObject.IPAddress(0);
}
</script>
</body>
</html>
相关问题
- #{facesContext} EL expression not resolved at runt
- jsp caching tag library
- JSP template implementation (Composite View Patter
- how to add a list of string into json object in js
- Two dimensional arraylist with c:foreach jstl tag
相关文章
- jsp里面的画布功能,为什么会出错?求大佬找下问题
- JSP String formatting Truncate
- Forward request from servlet to jsp
- Comparing string and boolean in Expression languag
- Passing a Java object value in Custom JSP tag
- Passing a enum value as a tag attribute in JSP
- Application Error: AccessControlException
- MySQL driver problem in my dynamic web project (JP
兄弟!问下eclipse搭建怎么弄!我卡这好久了!
在浏览器里按F12看
问题已解决