How to get current entire site url in sharepoint 2013

get current site url in sharepoint
Inside the java script add this code inside the App.js

 var siteUrl = _spPageContextInfo.webAbsoluteUrl;

    alert('site Url' + siteUrl);