0

I need to get url list, Title is ready, Title is not equals url.

var clientContext = SP.ClientContext.get_current();
var website = clientContext.get_web();
var list = website.get_lists().getByTitle("ListTitle");

How to get url list?

3

You can get the URL of the list as below:

var clientContext = SP.ClientContext.get_current();
var website = clientContext.get_web();
var list = website.get_lists().getByTitle("ListTitle");
var rootFolder = list.get_rootFolder();
clientContext.load(list);
clientContext.load(rootFolder);
clientContext.executeQueryAsync(function () {
    console.log(list.get_rootFolder().get_serverRelativeUrl());
},
function (sender, args) {
     console.log('error');
});   
  • Thanks Gautam, i understand list.get_rootFolder() -> get_serverRelativeUrl() !!!! – Fox Jun 13 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.