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, '');

Comments

Popular posts from this blog

SharePoint 2013: Error updating managed account credentials

How can I call a JIRA api through Powershell?