日期:2014-05-16  浏览次数:20340 次

关于浏览器地址的获取,在线等,谢谢
比如地址是这样的http://localhost/file/index.html
获取的地址是http://localhost/file/

http://community.csdn.net/Expert/PostNew.asp?room=304是这样的
获取的是http://community.csdn.net/Expert/

谢谢了

------解决方案--------------------
function showurl()
{
var url=new String(top.location);
return url.substr(0,url.lastIndexOf( "/ ")+1);
}