Thứ Ba, 26 tháng 8, 2014

JavaScript: Window Location

The window.location object can be written without the window prefix.

Some examples:
  • location.href returns the href (URL) of the current page
  • location.hostname returns the domain name of the web host
  • location.pathname returns the path and filename of the current page
  • location.protocol returns the web protocol used (http:// or https://)
  • location.assign loads a new document

Không có nhận xét nào:

Đăng nhận xét