This is my js file. I have a bit of problem which while entering search for next time content is not updating even though request is successful. What should I do to update my content?
$(document).ready(function () {
$("#finding").unbind().click(function (e) {
e.preventDefault();
var searchQuery;
searchQuery="Vikram"
searchQuery = $("#searchQuery").val();
console.log(searchQuery);
var playListURL = "https://cors-anywhere.herokuapp.com/https://en.wikipedia.org/w/api.php?action=opensearch&search="+searchQuery+"&limit=10&namespace=0&format=json";
$.getJSON(playListURL, function (data) {
myData=data;
console.log(myData);
displayData(data);
});
});
});
console.log(myData);
function displayData(data) {
if(myData!==null){
for (var i = 1; i < 10; i++) {
console.log(myData);
$("#first").append("<p>" + myData[1][i] + "</p>"+"<p>" +myData[2][i]+"</p>"+myData[3][i]+"<hr>" )
}
}
}
If this is being asked already please provide the links for the same.