Home | Top | Web development | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |
Sets or retrieves the port number associated with a URL.
Syntax
N/A |
object.port [ = sPort ] |
Possible Values
sPort | String that specifies or receives the port number associated with the URL. See remarks. |
The property is read/write. The property has no default value.
Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see About Dynamic Properties .
Remarks
The port will resolve based on the default port for the protocol set in the HREF attribute: 21 for FTP, 80 for HTTP, and so forth.
Proprietary protocols that do not require a port return 0 or an empty string.
location.port returns an empty string when read in a page reached by the http protocol.
Example
This example function returns the port property of two a elements.
<SCRIPT>Standards Information
There is no public standard that applies to this property.
Applies To
|
A , AREA , location |
Home | Top | Web development | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |