Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8267813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:40:14+00:00 2026-06-08T05:40:14+00:00

I have a problem if i want to insert this json test into my

  • 0

I have a problem if i want to insert this json test into my phonegap page(which has jquery mobile included):

var JSONObject = {  "name" : "Amit",
                 "address"  : "B-123 Bangalow",
                 "age"  : 23, 
                 "phone"   : "011-4565763",
                 "MobileNo"  : 0981100092
             };

             document.write("<h2><font color='blue'>Name</font>::"
                            +JSONObject.name+"</h2>");  
             document.write("<h2><font color='blue'>Address</font>::"
                            +JSONObject.address+"</h2>");  
             document.write("<h2><font color='blue'>Age</font>::"
                            +JSONObject.age+"</h2>");  
             document.write("<h2><font color='blue'>Phone No.</font>::"
                            +JSONObject.phone+"</h2>");  
             document.write("<h2><font color='blue'>Mobile No.</font>::"
                            +JSONObject.MobileNo+"</h2>");

Then it doesn’t work.. My question is, is JSON actually possible with phonegap+jquery mobile??

In the future i want a webservice which returns data in JSON format so that I can use this json data in my phonegap app.. I am now testing if json data works, by using hardcoded data..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:40:16+00:00Added an answer on June 8, 2026 at 5:40 am

    It’s probable this code is called after the page has finished loading.

    So there is no point in using document.write.

    Simply use the html function to fill what you want to fill (probably a div).

    Note that you must wait for the DOM to be fully loaded. The best practice is to use the onload event handler and to put the script element at the end of the body.

    <div id=idOfTheDivWhereYouWantToWrite></div>
    <script>
    $(document).ready(function() {
        var JSONObject = {  "name" : "Amit",
                 "address"  : "B-123 Bangalow",
                 "age"  : 23, 
                 "phone"   : "011-4565763",
                 "MobileNo"  : 0981100092
        };
        var html= "<h2><font color='blue'>Name</font>::"+JSONObject.name+"</h2>" 
        html += "<h2><font color='blue'>Address</font>::" +JSONObject.address+"</h2>";  
        html += "<h2><font color='blue'>Age</font>::" +JSONObject.age+"</h2>";  
        html += "<h2><font color='blue'>Phone No.</font>::"+JSONObject.phone+"</h2>";  
        html += "<h2><font color='blue'>Mobile No.</font>::"+JSONObject.MobileNo+"</h2>";
        $('#idOfTheDivWhereYouWantToWrite').html(html);
    });
    </script>
    

    Besides, a “JSON object” doesn’t mean much as JSON is an exchange format. This is just a plain javascript object.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this problem i want to load an iframe, but when you insert
I have a problem that when we want to Insert a data into a
I have this problem: I want to generate a new source code file from
If I want to insert a variable %s into this <p><img src= %s alt=tetris/></p>
I have a small problem. My app has a database which stores lazy loaded
I have problem with php's preg_match.I want to make something like this : When
I have a problem when developing a single page web app. When jQuery send
I have this command: INSERT INTO table2 (username,profile) SELECT DISTINCT username,profile FROM table1 WHERE
I have this problem that i want to transfer specific ( yet not that
Hy I want to insert into ODBC and I have the error: ERROR [42000]

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.