Hi Guest

MobileUser

1 HomePage 1 Jobs 1 WalkIn 1Articles  

Cat Exam

 :) Latest Topic
AJAX
VB.NET
SQL Query
UDDI
CLASS
JavaScript Questions
SharePoint Interview
SilverLight
WCF
general knowledge
 ASP.NET
 :) Hot Jobs
 
 :) Latest Articles


  

 


Javascript code to get URL and Its different parts through code?
Question Posted on 18 Oct 2021

Home >> JavaScript >> Javascript Code >> Javascript code to get URL and Its different parts through code?




Javascript code to get URL and Its different parts through code?
Below is the code to get different part of URL in Javascript
(1)window.location.protocol=This will return "http:" or "https:"
(2)window.location.host=This will return rest part of url like "crackyourinterview.com"
(3)window.location.pathname=this will return the part after .com like "/MainAds-web.aspx"
(4)window.location.search=this will return ?s=search text
0
0



 
 Input Your Comments Or suggestions(If Any)
 Name
 Email(optional)
 Comments


Other Important Questions
Code to find last occurrence of any word in given sentance or string in Javascript?
Reverse a Array in Javscript by using reverse keyword?
Javascript code to get URL and Its different parts through code?
Function to disable Back Button in javascript
selected radiobuttonlist value in javascript






 
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |