var d_url=document.location.href; var d_url1=d_url.split(".html")[0]; var d_url2=d_url1.split("/")[5]; //http://localhost:8080/fg/cs/articleInformationDetail.html?param=022005 //截取param的值 //substring里只有第几位到第几位 var param = d_url.substring(d_url.length- 6,d_url.length);