How to get the Current URL in Jquery,Find Server Absolute Path

Get Current page URL - Jquery

There's two ways to get current url path,
$(document).ready(function() {
    var currenturl = window.location.pathname;
    alert($currenturl);
});

$(document).ready(function() {
    var currenturl = $(location).attr('href');
    alert($currenturl);
});

0 comments:

Post a Comment

How can we help? We’ll get back to you within 12 hours.
Feel free to ask,Your feedback is always appreciated...

Latest updates