To get the pages library items, using the JavaScript/JSOM. For that in the clientContext.load we have to pass "File" parameter and than the site columns(internal names)
getNewsPages = function() {
var clientContext = new SP.ClientContext.get_current();
var oList = clientContext.get_web().get_lists().getByTitle('Pages');
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml(" 50 ");
selectedDoc = oList.getItems(camlQuery);
clientContext.load(selectedDoc , 'Include(Id, Title,File,PublishedDate1,TeaserText,TeaserImage,FileRef,NewsFilter)');
clientContext.executeQueryAsync(gettingNewsPagesSuccess , onQueryFailed);
},
gettingNewsPagesSuccess = function() {
var listItemEnumerator = selectedDoc.getEnumerator();
while (listItemEnumerator.moveNext()) {
var oListItem = listItemEnumerator.get_current();
tempList.push({
"Id": oListItem.get_id(),
"Title": oListItem.get_item('Title') ,
"PublishedDate": oListItem.get_item('PublishedDate1'),
"TeaserText": oListItem.get_item('TeaserText') ,
"TeaserImage": oListItem.get_item('TeaserImage'),
"Path": oListItem.get_item('FileRef'),
"NewsFilter": oListItem.get_item('NewsFilter')
});
}
},
getNewsPages = function() {
var clientContext = new SP.ClientContext.get_current();
var oList = clientContext.get_web().get_lists().getByTitle('Pages');
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml("
selectedDoc = oList.getItems(camlQuery);
clientContext.load(selectedDoc , 'Include(Id, Title,File,PublishedDate1,TeaserText,TeaserImage,FileRef,NewsFilter)');
clientContext.executeQueryAsync(gettingNewsPagesSuccess , onQueryFailed);
},
gettingNewsPagesSuccess = function() {
var listItemEnumerator = selectedDoc.getEnumerator();
while (listItemEnumerator.moveNext()) {
var oListItem = listItemEnumerator.get_current();
tempList.push({
"Id": oListItem.get_id(),
"Title": oListItem.get_item('Title') ,
"PublishedDate": oListItem.get_item('PublishedDate1'),
"TeaserText": oListItem.get_item('TeaserText') ,
"TeaserImage": oListItem.get_item('TeaserImage'),
"Path": oListItem.get_item('FileRef'),
"NewsFilter": oListItem.get_item('NewsFilter')
});
}
},