I can't assign the returned result from the api to the <div>with prepend() function.Here is my codepen link.Please help!
Your URL says searchTerm, but what you have is searchedThing.
Also, don't import both Bootstrap 3 and 4. You probably had version 3 in mind. And jQuery should be imported before Bootstrap's JS file.
You have a couple errors. As soon as I made the following changes, it worked for me.
Beat me by that much.
Thanks a lot guys it really helped
I have another question, will my code work if i change the $.ajax() with .getJSON() and which one is better to use?
Why don't you try it ? (Spoilers: Looks like .getJSON() works fine )
If .getJSON() worked, that's what I'll use, since it's simpler. But .ajax() will give you more control.