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

  • Home
  • SEARCH
  • 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 8033719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:47:06+00:00 2026-06-05T01:47:06+00:00

I am trying to manipulate an array that I call from a PHP file.

  • 0

I am trying to manipulate an array that I call from a PHP file. It sends

[{
    "description": "Intel H67 Socket 1155 Motherboard",
    "price": "144.99"},
{
    "description": "Thermaltake WO319RU 850 Watt PSU Modular",
    "price": "169.99"},
{
    "description": "LG GH24NS70 SATA DVD Burner",
    "price": "39.99"},
{
    "description": "eVGA GTX 480 1536MB GDDR5",
    "price": "299.99"}]

This is my jQuery

$(document).ready(function() {
function get() {
  var postdata = $('#scu').val();
    $.post('data.php', {scu:postdata}, function(output) {
        $('#output').append(output);
    });
  }
$('#scu').keyup(get);
});
//#scu is a textbox
//#output is an empty div

If i call it like this it shows the entire array; if i call it like output[0] I’ll get [; if i call it like output[0].price i get an unknown' error.

  • 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-05T01:47:08+00:00Added an answer on June 5, 2026 at 1:47 am
    $.post('data.php', {scu:postdata}, function(output) {
          // looping over output
          $.each(output, function(index, obj) {
            // obj contains each object eg.
            //  {
            //    "description": "Intel H67 Socket 1155 Motherboard",
            //    "price": "144.99"
            //  }
    
            console.log(obj.description);
            console.log(obj.price);
            // to append to textbox do something like this
            $('#scu').append(obj.description); // and so on
         });
    }, 'json'); // you need to put dataType here as json, as output is json
                // you don't need $.parseJSON, because dataType json will
                // parse it for you
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to store an array and manipulate that array using a custom
I am trying to manipulate a conditional string outputted from SAS into the right
Here's the deal. I have a large character array and am trying to manipulate
I am trying to call a procedure in a Delphi DLL from C#. The
I'm trying to manipulate the sorting order of an array. I would like to
I have a UTF8_encoded array in PHP (5.3) but can't seem to use manipulate
I am trying to manipulate SharePoint's default calendar to add, edit and delete items
I'm having trouble trying to manipulate music using buttons I can't seem to make
I'm looking for a good python library to manipulate subversion repositories. I'm trying out
I have been trying to manupulate registry key from python using the win32api module

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.