document对象相关参数获取 :
location:子对象
document.location.hash // #号后的部分
document.location.host // 域名+端口号
document.location.hostname // 域名
document.location.href // 完整URL
document.location.pathname // 目录部分
document.location.port // 端口号
document.location.protocol // 网络协议(http:)
document.location.search // ?号后的部分
获取#的位置截取字符串的形式 例如:
var url=window.location.href;//获取地址栏 url
var index=url.indexOf(’#’);//获取#的位置
var paramVal=url.substr(index,url.length);//获取 # 后面所有字符串