I was working on the Wikipedia Viewer project. I got the search results displayed on my page. However, when I clicked on one of the results, it didn’t direct me to that particular entry page. I assigned the link to the href attribute. I have no idea why it’s not working. Here’s my code. https://codepen.io/Minyang64/pen/MvBRxG?editors=1111
I think it is a codepen thing. Using target="_blank"
should fix it.
Ben’s suggestion should fix your issue. I just wanted to point out that you have a spelling error in your JS, line 17.
I modified the code but still couldn’t get to the result entry page.
$(’#output’).prepend(’
’+data[2][i]+’
Have a look at your quotes and spaces. Your code produces the following a
tag (screenshot from browser “Elements inspector”):
Problem solved. Thank you for your help.
It worked fine with Chrome but failed with Firefox. Tried to add Element Inspector but got warned that the add-on was not compatible with my version of Firefox.