Return the port number of the current URL:
The result of x will be (If the port number is 80, which is default, nothing will be returned):
The port property sets or returns the port number the server uses for a URL.
Note: If the port number is not specified in the URL (or if it is the scheme's default port - like 80, or 443), some browsers will display 0 or nothing.
Property | |||||
---|---|---|---|---|---|
port | Yes | Yes | Yes | Yes | Yes |
Return the port property:
Set the port property:
Value | Type | Description |
---|---|---|
port | String | Specifies the port number of the URL |
Return Value: | A String, representing the port number of a URL. Note: If the port number is not specified or if it is the scheme's default port (like 80 or 443), an empty string is returned |
---|