SharePoint 2013 - Get Variation URL using JSOM
From the variation information on this blog, http://blogs.technet.com/b/stefan_gossner/archive/2011/11/21/sharepoint-variations-the-complete-guide-part-6-configuration-internals.aspx, I used the following code to get the corresponding variation URL to create the toggling button for a publishing site. Type.registerNamespace('spapp'); var context; spapp.url = "https://rchen.sp.com"; spapp.language; spapp.languageHome; spapp.curPageUrl; spapp.relationshipList; spapp.relationshipItems; $(document).ready(function () { var toggleHtml = ' Toggle '; $('#RibbonContainer-TabRowRight').prepend(toggleHtml); SP.SOD.executeFunc('sp.js', 'SP.ClientContext', spapp.init); }); spapp.init = function(){ context = new SP.ClientContext(spapp.url); }; spapp.toggleLanguage = function(){ spapp.curPageUrl = _spPageContextInfo.serverRequestPath; spapp.language = _spPageContextInfo.currentCultureName; spapp.relationshipList = ...