js之location对象

来源:互联网 发布:php获取ip地理位置 编辑:程序博客网 时间:2024/06/08 12:59

Location对象

location用于获取或设置窗体的URL,并且可以用于解析URL。

语法:

location.[属性|方法]

location对象属性图示:

location 对象属性:

location 对象方法:

demo:
<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>location</title></head> <script type="text/javascript">alert( location.href);          </script></head><body></body></html>


0 0
原创粉丝点击