<script language=javascript>
alert(window.location.search.split("&")[0].split("=")[1]);
</script>

解决方案 »

  1.   

    补充
    <script language=javascript>
    aa=window.location.search.split("&")[0].split("=");
    if(aa.length>0) alert(aa[1]);
    </script>
      

  2.   

    do you guys really understand what he is asking for?? read it again:如果是打开test.js?id=1,2,3
          ^^^^^^^^^^^^^^^^^^^^^
    我想在test.js中得到"1,2,3",用Javascript该如何写呢?
         ^^^^^^^^^^^^^^^^^^^^^
      

  3.   

    谢谢各位~~~ 不好意思, 是我没说明白。 
    是这样的, 假设:我访问 test.asp?id=111,222,333 这个页面
    我不想用ASP来获取ID=后的东西, 我是想用Javascript获得"111,222,333",获得后让"111,222,333"显示在页面中。