How to dynamically construct the SharePoint site relative url in JavaScript
There are times when you want to dynamically construct a SharePoint site relative Urls e.g. if you are calling a SharePoint webservice from JQuery etc. then you will need to call it in context of your required site.
Most people try to slice and dice the URL of the current page and try to find the SharePoint site from it. This is not a very clean way of doing it.
The more easy and clean way is the way SharePoint itself does which is using the JavaScript variable called sample cialis levitra viagra https://servingourchildrendc.org/format/choosing-a-college-application-essay-topic/28/ essay mobile advantages disadvantages enter site https://www.cen.edu/notice/personal-essay-sample-for-nursing-program/24/ https://efm.sewanee.edu/faq/why-do-you-want-to-be-a-nurse-college-essay/22/ follow link definition of exploratory research https://kirstieennisfoundation.com/dysfunction/axen-23-levitra-beyaz/35/ watch help writing my dissertation go site female viagra lybrido gerd taking nexium go site https://www.innovativefitness.com/perioded/escitalopram-y-viagra/37/ https://bigsurlandtrust.org/care/no-prescription-lasix-ship-overnight/20/ viagra price war here https://zacharyelementary.org/presentation/words-for-transition-in-an-essay/30/ research method for dissertation https://ncappa.org/term/research-paper-on-attitude/4/ come si assume sildenafil cialis fiyatlar ankara cipro poisoining https://georgehahn.com/playboy/is-eating-watermelon-like-taking-viagra/15/ https://pharmacy.chsu.edu/pages/dissertation-literature-review-help/45/ cordarone et viagra essay on love all serve all writing an inspirational speech a review of lumbar spondylolisthesis go L_Menu_BaseUrl
This variable holds the relative url of current site.
So for example, if you want to call Lists.asmx for
http://yourintranet/sites/Finance/ then
L_Menu_BaseUrl + ‘/_vti_bin/Lists.asmx’ will give you the required url for web service.
3 Responses to “How to dynamically construct the SharePoint site relative url in JavaScript”
Comment from sharepoint csharp
Time September 23, 2010 at 12:26 pm
This is useful – does it apply in code behind? I can’t seem to find the relative url for use within a menu tag :/
Comment from Bassam Tantawi
Time December 3, 2012 at 12:48 pm
Thank you very much, useful one 🙂
Comment from Search engine Optimization
Time August 15, 2010 at 5:46 am
Hi thr, thanxc a lot for this blog …….. This is what I was looking for.