Using an API call, how can I get the data to show in HTML?
-
Let's say I make an API call and I get usernames and photos in JSON format. How can I render the photos and usernames in HTML. As an example, let's say with the data that's returned I get image url's that I can input into img src in an img tag and grab the username associated with it and show it next to an image. How can I do that?
-
Answer:
Do something like this <script type="text/javascript">var elem = document.createElement("img"); img.src = 'myImageSource.jpg'; document.getElementById("placehere").appendChild("elem");</script> Nowdays there are some libraries for making it easier (or sometimes more complicated) like jQuery.
Petr Chloupek at Quora Visit the source
Related Q & A:
- How can I insert posted data into the database?Best solution by Stack Overflow
- How can I get a job at Universal in a show?Best solution by universalstudioshollywood.com
- How can I get pictures to show up in questions?Best solution by answers.yahoo.com
- How can I get cash on ebay by using a paypal?Best solution by Yahoo! Answers
- How can I get inbound/outbound call process?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.