Hey guys, i am stuck on the Wikipedia viewer. So the problem is that i get an error when the function renderHTML(wikiDataSave); is called. The code looks as it should be but i can’t figure out where i am making mistake. Please help!!!
Feel free to download the code and test it in your browsers.
Thanks
Hey @ivanilievski,
I noticed a couple of things when I tried to run your code:
Your HTML markup in CodePen does not have the tags for html, head or body
The type of your input with id src has a typo. You wrote tetx instead of text.
In your renderHTML function, in your for loop declaration, you are using the query variable without ever declaring it.
function renderHTML(data){
var htmlTitle = "";
for (var i=0; i<query.search.length;i++){ // <----- Where is query declared?
htmlTitle = "<p>"+ query.search.title[i] +"</p>";
}
listSearch.insertAdjacentHTML("beforeend", htmlTitle);
}