I can’t assign the returned result from the api to the <div>
with prepend() editors=1011).
Please help!
1 Like
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.
1 Like
You have a couple errors. As soon as I made the following changes, it worked for me.
- remove all references to Bootstrap 4 in your settings.
- jQuery must come before Bootstrap in settings.
- You’re calling a variable that doesn’t exist. Change
searchTerm
tosearchedThing
1 Like
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.
1 Like
Thanks