asp 如何调用SCRIPT里面的变量值?
在<SCRIPTlanguage=JScriptevent=OnObjectReady(objObject,objAsyncContext)for=foo>if(objO...
在
<SCRIPT language=JScript 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.DNSHostName != null && objObject.DNSHostName != "undefined")
sDNSName = objObject.DNSHostName;
}
</SCRIPT>
<OBJECT id=locator classid=CLSID:76A64158-CB41-11D1-8B02-00600806D9B6 VIEWASTEXT></OBJECT>
<OBJECT id=foo classid=CLSID:75718C9A-F029-11d1-A1AC-00C04FB6C223></OBJECT>
<SCRIPT language=JScript>
var service = locator.ConnectServer();
var MACAddr ;
service.Security_.ImpersonationLevel=3;
service.InstancesOfAsync(foo, 'Win32_NetworkAdapterConfiguration');
</SCRIPT>
<SCRIPT language=JScript>
var service = locator.ConnectServer();
var MACAddr ;
service.Security_.ImpersonationLevel=3;
service.InstancesOfAsync(foo, 'Win32_NetworkAdapterConfiguration');
</SCRIPT>
我想得到MACAddr的值,如何写? 展开
<SCRIPT language=JScript 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.DNSHostName != null && objObject.DNSHostName != "undefined")
sDNSName = objObject.DNSHostName;
}
</SCRIPT>
<OBJECT id=locator classid=CLSID:76A64158-CB41-11D1-8B02-00600806D9B6 VIEWASTEXT></OBJECT>
<OBJECT id=foo classid=CLSID:75718C9A-F029-11d1-A1AC-00C04FB6C223></OBJECT>
<SCRIPT language=JScript>
var service = locator.ConnectServer();
var MACAddr ;
service.Security_.ImpersonationLevel=3;
service.InstancesOfAsync(foo, 'Win32_NetworkAdapterConfiguration');
</SCRIPT>
<SCRIPT language=JScript>
var service = locator.ConnectServer();
var MACAddr ;
service.Security_.ImpersonationLevel=3;
service.InstancesOfAsync(foo, 'Win32_NetworkAdapterConfiguration');
</SCRIPT>
我想得到MACAddr的值,如何写? 展开
1个回答
展开全部
首先你要明确一个概念,JS是客户端执行的,ASP是服务器端执行的,ASP在解释输出HTML文档时,JS变量还没载入到浏览器。
所以,除非你进行页面提交,也就是指发生页面跳转,否则是无法把JS的变量值提给asp使用的。
比如:
function jump(v){
window.location.href="页面自身的文件名.asp?value="+v;
}
然后在此asp文件开始处用Request.QueryString("value")接收进行处理。
所以,除非你进行页面提交,也就是指发生页面跳转,否则是无法把JS的变量值提给asp使用的。
比如:
function jump(v){
window.location.href="页面自身的文件名.asp?value="+v;
}
然后在此asp文件开始处用Request.QueryString("value")接收进行处理。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询