Javascript: Get the current root url
This may not be the easiest way, but is certainly worked for me.
var url = $(location).attr('href').replace(window.location.pathname, '').replace(window.location.search, '');
var url = $(location).attr('href').replace(window.location.pathname, '').replace(window.location.search, '');
Comments
Post a Comment