mardi 6 janvier 2015

not getting getWebRelativeFriendlyUrl using sp.publishing.js. Same for getAllParentTerms



I am not getting getWebRelativeFriendlyUrl using sp.publishing.js. Same for getAllParentTerms.


Code below:



function getURL()
{ // Create an instance of the current context to return context information clientContext = SP.ClientContext.get_current();
this.website = clientContext.get_web();
var navterm = new SP.Publishing.Navigation.NavigationTerm();
clientContext.load(navterm)
//Executes the current pending request asynchronously on the server clientContext.executeQueryAsync(onRequestSucceeded, onRequestFailed); }
//the delegate of the method that is called when the request is executed successfully function onRequestSucceeded()
{
alert(navterm.getWebRelativeFriendlyUrl());
alert(navterm.getAllParentTerms());
}
//the delegate of the method that is called when the request is executed unsuccessfully function onRequestFailed(sender, args)
{
alert('Error: ' + args.get_message());
}


I am getting error on



var navterm = new SP.Publishing.Navigation.NavigationTerm();


Please help. Thanks in advance.








0 commentaires:

Enregistrer un commentaire