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);