javascript如何得到浏览器地址栏输入的内容 http://lucky.myrice.com/javascriptexam/QueryString.htm?xxx=xxxxxxxxxxxxxxx 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 location对象可以得到location.href 我需要得到的是浏览器地址栏中输入的内容,比如我在地址栏中输入:http://www.sina.comw 我是想用一个函数得到我在地址栏中输入的“http://www.sina.com”我就是想问有没有这个函数 可以的。<script language=javascript> alert(window.location.href.substring(0, window.location.href.lastIndexOf("/"))); </script> shqlsl(www.51js.com) 谢谢你,可是我试了你的方法,没有得到我要的结果啊,返回的值是:NaN,这是什么意思啊 <script language=javascript> alert(window.location.href.substring(0,window.location.href.lastIndexOf("/"))); </script> 可以呀!保存为一个文件打开试试 设置或获取 location 或 URL 的 hostname 和 port 号码。<script>alert(window.location.host)</script> “天气预报”超实用手机应用软件完整源码下载 用js往select里面赋值的问题,很简单 怎样删除Ext.ux.UploadDialog上传后的文件? 用过DevExpress控件的帮下忙了哈 100分求《javascript权威指南》配书源码 分数只有这么多了,统统给了 这个常用的选项应该怎样写呀,假设我现在在1.asp中,id="" 页面转向index.asp 800里加急,紧急问题:javascript导出数据到Excel <select>对齐内容1 对齐内容2 </select> 谁有下拉菜单的例子? 关于透明文本框? javascript中实现list数据的即时过滤
<script language=javascript>
alert(window.location.href.substring(0, window.location.href.lastIndexOf("/")));
</script>
alert(window.location.href.substring(0,window.location.href.lastIndexOf("/")));
</script>
可以呀!保存为一个文件打开试试
<script>
alert(window.location.host)
</script>