Having a problem in Wikipedia api while using async await?

Basicaly Im Using Asyn and Await for Requesting and handling the request.
But it seems like my javascript is doing nothing. This is my pen on CodePen.

Any Help is openheartly welcome.

Thanks in advance

@Abd.Qadir,
opening your project in code pen first reveals you have a syntax error in your javascript on line 19. What is error.*? You probably meant error
Second, you are immediately calling your async task and not waiting for any input by the user and thus you are getting an error.
I would suggest to either create a listener for a button click or attach an onclick attribute to the button to call your async function.

Hope that helps.

1 Like

@camperextraordinaire @TomerPacific

Thank you for your precious instructions but I am still not getting the needed object and clueless about what wrong is happening?

Sorry for disturbing again.

The Pen

@Abd.Qadir,
I ran your code on my machine and it seems to work:

By the way, I would fix the typo you have in Viewer (you wrote Veiwer)

@TomerPacific

Ya, many Thanks.

I got the results on my machine too.
Finally, heading to bring the data on my page.

But, the last question
Why are my page items aligned at left on your machine though I have centered them!

@Abd.Qadir,
I must of forgotten to include Bootstrap when I ran your code. It’s not a problem with your code.

@TomerPacific & @camperextraordinaire

Thanks for All your help.
Sorry for the late reply. It took me longer to complete the project.
Maybe because of my poor understanding of APIs.
However, I have completed the project.

Here is the pen

Any feedback/criticism/advice is welcome.

Thanks again

@Abd.Qadir,
good job following through and finishing the project :+1:
The overlook is very clean and user friendly.
I would maybe add a border around each article, just to create a separation between each link or anything else you may find that fits.

Also, the animation of the search box, to my taste, is a bit much. There are very rare scenarios where it needs to be that wide.