惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
Y
Y Combinator Blog
博客园 - 【当耐特】
V
Visual Studio Blog
GbyAI
GbyAI
V
V2EX
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
Microsoft Security Blog
Microsoft Security Blog
D
DataBreaches.Net
Hugging Face - Blog
Hugging Face - Blog
A
About on SuperTechFans
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
aimingoo的专栏
aimingoo的专栏
B
Blog RSS Feed
量子位
MongoDB | Blog
MongoDB | Blog
有赞技术团队
有赞技术团队
人人都是产品经理
人人都是产品经理
Stack Overflow Blog
Stack Overflow Blog
小众软件
小众软件

博客园 - fool

convert sqlserver日期处理(转载) 转 event对象 C# dbparameter几点需要注意的地方 详解如何实现最基本的AJAX框架 转载 ASP.NET HTTP运行时组成详解 转ASP.NET 表单 (翻译) 1024和800分辨率下浏览器宽度和宽度的设定研究[转] 做网页的尺寸 接受按键 - fool - 博客园 可运行代码的输入框 选项卡的制作 一些常用的小脚本 设置首页和加入收藏与火狐兼容 图片轮显 页面的切入切出效果 改变背景色的js代码 ie中双倍边界问题 表格的rowspan应注意的
location对象
fool · 2008-07-27 · via 博客园 - fool

  window的一个对象

  如果浏览的页面地址为

  http://www.web.com/index.aspx?id=1#somename

  那么

  location.href的为

http://www.web.com/index.aspx?id=1#somename

 location.hash的值为somename

 location.host的值为www.web.com

 location.protocol的值为http

 location.port的值为空 因为默认是 80端口 但是即使设置成80端口也会取不到其他端口可以

 location.pathname的值为/index.asp

 location.search的值为?id=1

 location.hash的相关应用

 有个地方就是ajax方面我没有试验过

 在网上看到一个文章

 由于没实践 先放这吧

var hash;
hash
=(!window.location.hash)?"#search":window.location.hash;
window.location.hash
=hash;
   
//调整地址栏地址,使前进、后退按钮能使用
switch(hash){  
case "#search":
     selectPanel(
"pnlSearch");    //显示普通搜索面板
     break;   
case "#advsearch":   
      
case "#admin":
     
}