Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
What are the various url properties of location object in Javascript?
Home
JavaScript
What are the various url properties of location object in Javascript?
0
votes
asked
Oct 4, 2023
in
JavaScript
by
GeorgeBell
What are the various url properties of location object in Javascript?
javascript-interview-questions-answers
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Oct 4, 2023
by
GeorgeBell
The below
Location
object properties can be used to access URL components of the page,
href - The entire URL
protocol - The protocol of the URL
host - The hostname and port of the URL
hostname - The hostname of the URL
port - The port number in the URL
pathname - The path name of the URL
search - The query portion of the URL
hash - The anchor portion of the URL
...