Aryan PrajapatKnowledge Contributor
What are the various url properties of location object
What are the various url properties of location object
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
The location object in JavaScript has several properties related to the URL:
1. href – The entire URL.
2. protocol – The protocol (e.g., http:, https:).
3. host – The hostname and port (e.g., example.com:80).
4. hostname – The hostname (e.g., example.com).
5. port – The port number (e.g., 80).
6. pathname – The path of the URL (e.g., /path/to/resource).
7. search – The query string (e.g., ?query=string).
8. hash – The fragment identifier (e.g., #section).