var context = new SP.ClientContext(); var relativeWebUrl = context.get_url();
Site Collection Url | Site Url | context.get_url() response |
---|---|---|
http://site.com | http://site.com | / |
http://mysite.com | http://site.com/site1 | /site1 |
http://site.com/sites | http://site.com/sites/site1 | /sites/site |
function getFullWebUrl() { var context = new SP.ClientContext(); var relativeWebUrl = context.get_url(); var fullWebUrl = window.location.protocol + '//' + window.location.host + relativeWebUrl ; alert(fullWebUrl); }
No comments:
Post a Comment
Thank you for Commenting Will reply soon ......