GoFuture's Blogs

为自己加油,努力啦,木头人。。。。。 我就是我,因为努力而独一无二的我!!!

 

2011年4月20日

js的url取值

摘要: 例如地址: http://www.juuyou.com:8080/test.html?aaa=bbb#dddd如果要取得域名,一般人应该会去通过indexof(),split(),substring()等方法处理。但有更简单的。下面说下怎么获取和获取的值为什么:document.location.protocol — http:document.location.hostname — www.juuyou.comdocument.location.host — www.juuyou.comdocument.location.port — :8080document.location.pathn 阅读全文

posted @ 2011-04-20 14:50 GoFuture 阅读(680) 评论(1) 推荐(0) 编辑

导航