06JavaScript of history objects, Location Object

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/Denial_learn/article/details/100590564

history objects:

  • Url contains the user access to information stored in the browser window
  • Is part of the window object, can be accessed through its property window.history

Note: For the public should not mark the history object, but all browsers support the object

history.back()//返回到上一个页面
history.forward()//前进到下一个页面
history.go()//go里面可以填充数字,正数为前进几个历史,负数为后退几个页面

Location object:

  • It is actually a JavaScript object, rather than HTML DOM object.
  • Is a JavaScript runtime engine automatically created that contains information about the current URL
  • Is part of the Window object, can be accessed by window.location property

Location address bar represents the current Object Browser. The browser's address stored in the main is to access the URL address of a Web site.

URL: Uniform Resource Locator.

http://www.baidu.com:80?username=zhangsan&age=23&addredd=beijing

Protocol HTTP protocol used when current browser to visit a Web site.

  1. This is a domain name www.baidu.com, hormone Internet actually behind a corresponding ip address, ip address corresponding to a device in
  2. 80 access is to specify the ip software program on this server running on which port.

Location.href get current ur, you can also fill in behind a web site, to achieve the jump page.
E.g:
Here Insert Picture Description

Guess you like

Origin blog.csdn.net/Denial_learn/article/details/100590564