How to Get the Current URL using JQuery?
In this post i give you three way to get current url in your js file as there are bellow listed:
Ok, so you can check bellow example code and run in your system.
<title>JQuery - get current URL Example</title>
var currentURL = window.location.href;
var currentURL = $(location).attr("href");
var currentURL = window.location;
I hope it can help you...
We are Recommending you
- How to Remove Special Characters from a String in JQuery?
- JQuery Moment Add Hours to Datetime Example
- JQuery Moment Get Current Date Example
- Jquery Only Allow Input Float Number Example
- How to use jQuery in Angular 10 Projects?
- How to Print Iframe Content using Jquery?
- Jquery Input Mask Phone Number Validation Example
- JQuery Radio Button Change Event Example
- How to Set Radio Button Checked Based on Value using JQuery?
- JQuery Open Link in New Window Example
- How to Get Current URL in Laravel?
- How to Get a Current Page URL in PHP?
- JQuery Delete Confirm Modal using Bootbox Example
- How to access PHP variables in JQuery?