Need help with the Wikipedia View project, no response when clicking on the search result

Need help with the Wikipedia View project, no response when clicking on the search result
0.0 0

#1

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


#2

I think it is a codepen thing. Using target="_blank" should fix it.


#3

Ben’s suggestion should fix your issue. I just wanted to point out that you have a spelling error in your JS, line 17.


#4

I modified the code but still couldn’t get to the result entry page.
$(’#output’).prepend(’

  • <a href= ‘+data[3][i]+‘target="_blank">’+data[1][i]+’

    ’+data[2][i]+’

  • ’)

    #5

    Have a look at your quotes and spaces. Your code produces the following a tag (screenshot from browser “Elements inspector”):
    err


    #6

    Problem solved. Thank you for your help.:grinning::grinning:


    #7

    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.