原文:http://xiarilian12.iteye.com/blog/520365
http://localhost/test/test.htm?id=1
<html>
Java代码
<head>
</head>
<body>
<script languge=javascript>
alert(window.location.pathname); --返回 /test/test.htm
alert(window.location.search); --返回 ?id=1
alert(window.location.href); --返回 http://localhost/test/test.htm?id=1
</script>
</body>
</html>
location对象 含有当前URL的信息. 属性 href 整个URL字符串.
protocol 含有URL第一部分的字符串,如http:
host 包含有URL中主机名:端口号部分的字符串.如//www.cenpok.net/server/
hostname 包含URL中主机名的字符串.如http://www.cenpok.net ;
port 包含URL中可能存在的端口号字符串.
pathname URL中"/"以后的部分.如~list/index.htm
hash "#"号(CGI参数)之后的字符串.
search "?"号(CGI参数)之后的字符串.
分享到:
相关推荐
avascript设计模式.pdf
Key Features ...Explore the concepts of object-oriented programming Follow this step-by-step guide on the fundamentals of JavaScript programming Book Description JavaScript is the most widely-used ...
avaScript语法概述.pdf
avascript教程.效果和源码.rar
About This Book Apply the core principles of concurrency to both browser and server side development Explore the latest tools and techniques at the forefront of concurrent programming, including ...
操作步骤: 1:打开calc.htm 2: Alt+D打开调试窗口 博文链接:https://fuhao9611.iteye.com/blog/72374
JavaScript Applications with Node.js, React, React Native and MongoDB: Design, code, test, deploy and manage in Amazon AWS By 作者: Eric Bush ISBN-10 书号: 0997196661 ISBN-13 书号: 9780997196665 ...
javascript 思维导图插件 avascript 思维导图插件 javascript 思维导图插件
avaScript语言精粹
网页制作-HTML+CSS+JAVAscript详细手册...JavaScript使用手册.chm JavaScript参考手册.chm JavaScript参考手册中文版.chm Javascript高级教程.CHM 样式表中文手册2.0.CHM 样式表滤镜中文手册.CHM 网页制作完全手册.chm
JavaScript+DOM编程艺术+清晰中文版 网页前端工程师的入门级图书 网页设计的必备书籍
香草JS项目:基于星级的评分应用 我的文章系列的源代码,有关构建基于星级的评分应用程序。
讲解IE 和 Firefox 浏览器 JavaScrip脚本兼容的应用。包括函数、属性、方法的讲解。适合IE与Firefox的通脚本。
avaScript表单验证大全
完全的客户端控件,不增加服务器压力,一切功能均在客户端实现,无需服务器进行实时的数据计算,如果需要服务器的交互,VG也提供相应的接口与方法来在客户端与服务器端进行轻量级XML交互数据。 基于Visual Graph...
avascript参考手册CHM版,中文版本
JavaScript一种直译式脚本语言,是一种动态类型、弱类型、基于原型的语言,内置支持类型。它的解释器被称为JavaScript引擎,为浏览器的一部分,广泛用于客户端的脚本语言!
avaScript之webgame学习最具实践性的资料--猫游记js代码大全.rar
avaScript文档对象模型是关于java的很好的一本书。很适合新手的学习阅读
一个asp和javascript传参数的列子