2017年10月7日 星期六

瀏覽器物件(5)Location

Location Object Properties

PropertyDescription
hashSets or returns the anchor part (#) of a URL
hostSets or returns the hostname and port number of a URL
hostnameSets or returns the hostname of a URL
hrefSets or returns the entire URL
originReturns the protocol, hostname and port number of a URL
pathnameSets or returns the path name of a URL
portSets or returns the port number of a URL
protocolSets or returns the protocol of a URL
searchSets or returns the querystring part of a URL

Location Object Methods

MethodDescription
assign()Loads a new document
reload()Reloads the current document
replace()Replaces the current document with a new one

沒有留言:

張貼留言