http://lucky.myrice.com/javascriptexam/QueryString.htm?xxx=xxxxxxxxxxxxxxx

解决方案 »

  1.   

    location对象可以得到location.href
      

  2.   

    我需要得到的是浏览器地址栏中输入的内容,比如我在地址栏中输入:http://www.sina.comw 我是想用一个函数得到我在地址栏中输入的“http://www.sina.com”我就是想问有没有这个函数
      

  3.   

    可以的。
    <script  language=javascript>  
    alert(window.location.href.substring(0,  window.location.href.lastIndexOf("/")));  
    </script>  
      

  4.   

    shqlsl(www.51js.com) 谢谢你,可是我试了你的方法,没有得到我要的结果啊,返回的值是:NaN,这是什么意思啊
      

  5.   

    <script  language=javascript>  
    alert(window.location.href.substring(0,window.location.href.lastIndexOf("/")));  
    </script>  
    可以呀!保存为一个文件打开试试
      

  6.   

    设置或获取 location 或 URL 的 hostname 和 port 号码。
    <script>
    alert(window.location.host)
    </script>