首页 > Web开发 > 详细

js 获取当前的网址

时间:2017-05-12 15:22:57      阅读:376      评论:0      收藏:0      [点我收藏+]
js 获取当前的网址
http://www.xcx.cc/index.php/home/index/ind?idf=12321
var $cur_url=window.location.href; //获取全部的网址
var $psurl = window.location.pathname; // 获取 index.php/home/index/ind
var $par = window.location.search; //获得 ?idf=12333
var test = window.location.host; // www.xcx.cc
if($par.length>0){
$psurl=$psurl+$par
}
alert($psurl);

js 获取当前的网址

原文:http://www.cnblogs.com/xqschool/p/6845579.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!