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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:29:44+00:00 2026-05-28T15:29:44+00:00

I am getting this output of json by doing this $.get(‘getDataPartySize.php’, function(data) { alert(data);

  • 0

I am getting this output of json by doing this

$.get('getDataPartySize.php', function(data) {
      alert(data);
});

Output of this is :

[object Object],[object Object],[object Object],[object Object],[object Object],
[object Object],[object Object],[object Object],[object Object],[object Object],
[object Object],[object Object],[object Object],[object Object],[object Object],
[object Object],[object Object],[object Object],[object Object],[object Object],
[object Object],[object Object],[object Object],[object Object],[object Object],
[object Object],[object Object]

and I tried ouput of getDataPartySize.php like below and getDataPartySize.php have also this header("Content-type: text/json");

[{"name":"waqar","size":"3"},{"name":"waqas","size":"8"},{"name":"jahangir","size":"6"},{"name":"wawar","size":"3"},
 {"name":"basit","size":"5"},{"name":"basit","size":"5"},{"name":"Ali","size":"4"},
 {"name":"basit","size":"4"},{"name":"Malik","size":"5"},{"name":"basit","size":"5"},
 {"name":"Kashif","size":"7"},{"name":"test","size":"5"},{"name":"Ch","size":"7"},
 {"name":"first","size":"10"},{"name":"2nd","size":"6"},{"name":"qasim","size":"10"},
 {"name":"saleem","size":"14"},{"name":"testing","size":"16"},
 {"name":"kashif","size":"10"},{"name":"Ch","size":"14"},{"name":"saleem","size":"6"},
 {"name":"new","size":"1"},{"name":"abc","size":"2"},{"name":"lahori","size":"3"},
 {"name":"newpak","size":"1"},{"name":"abc","size":"2"},{"name":"tabaq","size":"6"}
]

I am using jQuery. I don’t know what the problem is.

EDIT: also tried this, getting same output.

$.getJSON("getDataPartySize.php",function(result){
  alert(result);
}
  • 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-28T15:29:44+00:00Added an answer on May 28, 2026 at 3:29 pm

    specify the dataType

    $.get('getDataPartySize.php', function(data) {
          alert(data);
    },'json');
    

    or parse the json manually

    $.get('getDataPartySize.php', function(data) {
    var json = $.parseJSON(data);
          alert(json);
    //i would prefer 
    //console.log(json);
    //because alert tries to convert the objects to strings as mentioned by @Rocket in comments
    });
    

    here is the DEMO

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

Sidebar

Related Questions

I am getting a wrong output when i alert this, it shows '01' <input
I'm getting this problem: PHP Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable
I am getting DataTables warning: JSON data from server could not be parsed. This
I am doing this faq section by getting content from json files, which I
I am getting a JSON object in my javascript function in aspx page. I
I'm trying to pull data into flash using JSON but i keep getting this
I am getting the output as 0,1,2,3. I need this to be split into
Im trying to achieve an output like this {status:ok,0:{id:11,title:digg,url:http://www.digg.com}} but instead i am getting
I'm having trouble getting JSON data from my Rails app to display on a
I'm getting JSON-encoded output from another organization's API. In many cases, the output can

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.