Skip to content Skip to sidebar Skip to footer

How To Write Jsondata To The Html Element In Phonegap Application?

I am trying receive the JSON data using PhoneGap application. I am using server xampp php server. On this server I have server code api.php for receiving data from database. My la

Solution 1:

So if I understood you correctly, what you want to do is to get the email_id from the response and put the content into the div called email.

What you need to do is to first get the user's email from the JSON object which is in your case Array with just one item. This first item of array again is Object which contains field called email which is exactly what we want. After that we need to locate the div from the DOM with jQuery element selector and insert the user's email in it. Example is found below.

var userEmail = response[0].User.email; // Find the email from the JSONvar emailDiv = $("div#email"); // Find the div for email with jQuery selector
emailDiv.text(userEmail); // Put user's email as text to that div

Post a Comment for "How To Write Jsondata To The Html Element In Phonegap Application?"