Hot answers tagged

1

The SP.SOD.executeFunc function will always return undefined, as most SharePoint JS functions that run asynchronous code do. The third argument, your getPageTitle callback function, can be declared to return something, but that something cannot be captured by the SP.SOD.executeFunc function to be able to do var par = SP.SOD.executeFunc('sp.js', 'SP....


1

SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function(){ var par = getPageTitle(); //Do the rest of your logic here }); The third parameter is a callback function. The SP.SOD.executeFunc call doesn't actually return the value of your callback function. So you can supply your own callback function as above and do whatever you like (including ...


1

I guess you should have tried the following code. var termSetName = "Your term set name"; var locale = 1033; // your locale. Here is English var clientContext = SP.ClientContext.get_current(); var taxonomySession = SP.Taxonomy.TaxonomySession.getTaxonomySession(clientContext); var termStore = taxonomySession.getDefaultSiteCollectionTermStore(); var ...



Only top voted, non community-wiki answers of a minimum length are eligible