Friday, 22 April 2016

how to get current URL in jQuery/JavaScript?

To get the path, you can use:
var pathname = window.location.pathname; // Returns path only
var url      = window.location.href;     // Returns full URL

No comments:

Post a Comment

Alternative content