Latest news
Home » jQuery » How to get the current URL in javascript and jquery?

How to get the current URL in javascript and jquery?

Using the following jQuery script get the current loading URL

Jquery -:  var href = jQuery(location).attr(‘href’);

Javascript-: var href = window.location.pathname;

jQuery(document).ready(function() {
setTimeout(function() {

window.location.href = href;
 }, 3000); }); 

Leave a Reply

x

Check Also

How to Check Expired Sessions using jQuery Ajax and PHP

We can achieve using the php and ajax.The following ajax call execute in every 10 ...