找到答案了:
var path = "http://pitt/anycount/mystat.asp?userid=" + id+ "&style=2";
document.write("<script language=javascript src=" + path + "><\/script>");

解决方案 »

  1.   

    不好意思,另外问个问题:
     Javacript中怎样取得QueryString中的值呢,不用window.loaction.href中截取字符的方法。
      

  2.   

    <body> 
    <a href="javascript:location.href=location.href + '?a=1&b=2'">search</a> 
    <script language="JavaScript"> 
    <!-- 
    var a = location.search.substr(1); 
    if(a.length>0) 

     var re = /([^&]*?)\=([^&]*)/g 
     var s = a.match(re); 
     for(var i= 0;i<s.length;i++) 
     { 
      alert(s[i]); 
      alert(s[i].split("=")[1]); 
     } 

    //--> 
    </script> 
    </body>
      

  3.   

    <script src="http://test/count.asp?userid=<%=id%></script>,count.asp
    ==============================
    <%
    id=request("id")
    set rs=conn.execute("select 计数 from table where id="&id)
    if not rs.eof then
      response.write "document.write("&rs(0)&")"  
    end if
    rs.close
    set rs=nothing
    %>至于增加计数,安全过滤等,自己扩展