We have requirement to get all the non hidden lists of current web using JavaScript Client Object Model(JSOM). I have tried the below code but failed to get the desired result.
function GetListDetails() {
var ctx = new SP.ClientContext.get_current();
var web = ctx.get_web();
var user = web.get_currentUser();
user.retrieve();
var list = web.get_lists();
ctx.load(web);
ctx.executeQueryAsync(
function () {
tddetails.innerHTML = user.get_loginName();
},
function (data) {
alert('failed to get list. Error:' + data.get_message());
});
return false;
}
Looking for any sort of help.