I created an Sharepoint Hosted App where If I write a name of list and click on Submit.
It will fetch the data of that list and will show in a table.But when I enter any Library name It is also finding library as well.
Now I want to write a code where It only takes the name of list and search only list data when I enter any library name it should not search.
What should I do?
This is the code for button click
$('#hrefList').on('click', function () {
dynamicList = $('#txtList').val();
AnnouncementsListQueryUrl = appweburl + "/_api/SP.AppContextSite(@target)/web/lists/getbytitle('" + dynamicList + "')/items?@target='" + hostweburl + "'&$select=EncodedAbsUrl,ID,Title,Created,AuthorId,Author/Title&$expand=Author/Title&$orderby=Created
desc";
var scriptbase = hostweburl + "/_layouts/15/";
$.getScript(scriptbase + "SP.RequestExecutor.js", execCrossDomainRequest);
});
});