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 3842168
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:45:18+00:00 2026-05-19T15:45:18+00:00

I just started doing jQuery last week, and so far I already made some

  • 0

I just started doing jQuery last week, and so far I already made some basic systems with ajax, like basic jQuery CRUD and simple chat system without referencing on other’s work for I decided to test myself on how far I can do systems alone in jQuery(without JSON and XML yet).

But when I decided to look at other’s work (hoping to get/learn good practices and codes out there) many or almost every program that deals with ajax have some JSON in it. So I decided to study and read JSON specially this one, but I guess because it’s my first time dealing with it, I’m having a problem sinking it into my brain. Yeah I know it is a “lightweight way of describing hierarchical data”, I also know how to make JSON like mixing a literal array and object in JS, and how to dsplay it in js.

But my question is, what’s the difference and what’s the advantage than not using it?
When I can still get and store data on the server using ajax and database without JSON.
By the way I haven’t focus on XML yet because based from my research it’s better to use JSON in AJAX.

Can you give me some actual scenario dealing with

s1. ajax php mysql (this with what disadvantages?)

and

s2. ajax php mysql json (this with what advantages?)

I mean, my focus is to send and get data, and I already can do it with s1.

Sorry if you find my question stupid. Tia. 🙂

  • 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-05-19T15:45:18+00:00Added an answer on May 19, 2026 at 3:45 pm

    Why use JSON? The answer is portability and structure.

    JSON is portable because parsers and writers are available for many, many languages. This means that JSON that a PHP script generates can be very easily understood by a JavaScript script. It is the best way to transmit complex structures like arrays and objects, and have it still be compatible with multiple languages.

    JSON provides structure because the data you transmit with it can have consistent formatting. This is instead of transmitting back plain-text (i.e. unformatted) data, like comma-separated or delimited data.

    Data that is merely delimited (for example, “BookName1,BookName2,BookName3”) is more difficult for humans to understand, debug, and work with. If you wanted to debug a response between your server and your browser and the data was delimited (like my example above), you might have a hard time understanding it. Also, if you want to add different data types, provide separate records, etc., then your custom data format becomes more complicated. Eventually, you might end up reinventing JSON.

    As a side note, JSON is indeed better than XML. It is much more efficient space-wise. There are no tag names to take up space. Structure is created via nested braces, instead of verbose tags.

    Resources

    Here is an interesting article on the differences and pros/cons of XML and JSON: http://www.json.org/xml.html

    Examples

    Per your request, here is an example of encoding JSON with PHP. This is ripped from the docs:

    $arr = array ('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5);
    
    echo json_encode($arr);
    

    Output:

    {"a":1,"b":2,"c":3,"d":4,"e":5}
    

    Contrast this to something like this, without JSON:

    a,1
    b,2
    c,3
    d,4
    e,5
    

    To parse that, you’d have to iterate through each line, split the values yourself, and then create the array. This isn’t that difficult, but imagine you have a nested object:

    $arr = array ('a'=> array(1,2,3),'b'=> array('a' => 1, 'b' => 2),'c'=>3,'d'=> array(1,2,3,4,5) ,'e'=>5); // etc.
    

    With JSON, it’s no different to encode it. Just use json_encode. But, encoding this manually, and then decoding it manually would be significantly more work.

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

Sidebar

Related Questions

Just getting started with jQuery, and I've had some success so far. I've created
I just started using jQuery with themes and CSS framework. I am doing some
I've just started doing some real-world performance testing on my Fluent NHibernate / SQLite
I just started looking into the use of jQuery UI. What I would like
Just started a tutorial in SQL for beginners. I'm doing some exercises now and
I've just started doing some PowerShell scripting, and I'm running into a problem testing
I have just started doing some ImageMagick work. I am currently trying to convert
I'm doing some quite rudimentary jQuery stuff, getting started really, and I'm frequently navigating
I just started doing OOP, so I apologize in advance if there is a
I just started working with play, and I modified the way I'm doing a

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.