Window location.port property
- Previous page pathname
- Next page protocol
- Go up one level Window Location
Definitie en gebruik
port
Property instellen of retourneren van het poortnummer van de URL.
Tip:Als er geen poortnummer is gespecificeerd in de URL, of het een standaardpoort is (http is 80) of (https is 443), zal de meeste browsers een lege string retourneren.
Zie ook:
Syntaxis
Retourneer de property port:
location.port
Stel de property port in:
location.port = port
Eigenschapswaarde
Waarde | Beschrijving |
---|---|
port | Poortnummer van de URL. |
Retourwaarde
Type | Beschrijving |
---|---|
String |
Poortnummer van de URL. Als geen poortnummer is gespecificeerd of het een standaardpoort is (zoals 80 of 443), zal de meeste browsers een lege string retourneren. |
Browser support
All browsers support location.port
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
- Previous page pathname
- Next page protocol
- Go up one level Window Location