Last active
October 4, 2023 14:08
-
-
Save mailsonsoares/60e864a7d8156d7011cdcce413e4733c to your computer and use it in GitHub Desktop.
Obter partes do caminho da URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Exemplo de url: http://www.teste.com/account/search?filter=a#top | |
| window.location.pathname # /account/search | |
| window.location.host # www.somedomain.com (Se houver uma porta será exibida ao final) | |
| window.location.hostname # www.somedomain.com | |
| window.location.hash # #top | |
| window.location.href # http://www.teste.com/account/search?filter=a#top | |
| window.location.port # (Se houver uma porta será exibida) | |
| window.location.protocol # http: | |
| window.location.search # ?filter=a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment