在**.js文件中
var __cc_sys_url ="http://192.168.0.42:8081/count/"
//var __cc_sys_url ="http://"+window.location.host+":"+window.location.port+"/count/"
及***.asp文件中
<script language="JavaScript"
src="http://192.168.0.42:8081/count/**.js">
</script> 我想改成自动获取当前服务器IP及端口号
所以改成了如下:
在**.js文件中
var __cc_sys_url ="http://"+window.location.host+":"+window.location.port+"/count/"
及***.asp文件中
<script language="JavaScript"
src="http://"+window.location.host+":"+window.location.port+"/count/**.js">
</script>这样改不行,莫非把window.location改成document.location ,大家帮帮忙吧,谢谢了
var __cc_sys_url ="http://192.168.0.42:8081/count/"
//var __cc_sys_url ="http://"+window.location.host+":"+window.location.port+"/count/"
及***.asp文件中
<script language="JavaScript"
src="http://192.168.0.42:8081/count/**.js">
</script> 我想改成自动获取当前服务器IP及端口号
所以改成了如下:
在**.js文件中
var __cc_sys_url ="http://"+window.location.host+":"+window.location.port+"/count/"
及***.asp文件中
<script language="JavaScript"
src="http://"+window.location.host+":"+window.location.port+"/count/**.js">
</script>这样改不行,莫非把window.location改成document.location ,大家帮帮忙吧,谢谢了
JS文件
<script type="text/javascript">
var __cc_sys_url = "http://"+window.location.host + ":" + window.location.port+"/count/" ;
</script>
asp文件
<%
url = "http://" + Request.ServerVariables("HTTP_HOST") + ":" + Request.ServerVariables("SERVER_PORT") + "/count/**.js"
%>
<script type="text/javascript" src="<%=url%>"></script>
***.asp文件中
改为
<%
url = "http://" + Request.ServerVariables("LOCAL_ADDR") + ":" + Request.ServerVariables("SERVER_PORT") + "/count/**.js"
%>
<script type="text/javascript" src="<%=url%>"></script>
后,分别测试了一下,***.asp文件代码没有问题了,但是
在**.js文件中改成
<scripttype="text/javascript">var __cc_sys_url="http://"+window.location.host+":"+ window.location.port+"/count/" ; </script>
这个还是不对,请大家多费费心,呵呵,谢谢大家了
3Q~~~ 感谢!!
var __cc_sys_url = "http://"+window.location.host
就可以了.