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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:23:20+00:00 2026-05-10T22:23:20+00:00

i am trying to find the best way to display results on my page

  • 0

i am trying to find the best way to display results on my page via an Ajax call using jQuery, do you think the best way is to pass it as JSON or plain text? I have worked with ajax calls before, but not sure which is preferred over the other and for the JSON version what is the best way to read from a JSON file generated by a PHP page to display my results.

i know I would include a .each to run through it to display them all.

  • 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. 2026-05-10T22:23:21+00:00Added an answer on May 10, 2026 at 10:23 pm

    Something like this:

    $.getJSON('http://mywebsite.com/json/get.php?cid=15',         function(data){           $.each(data.products, function(i,product){             content = '<p>' + product.product_title + '</p>';             content += '<p>' + product.product_short_description + '</p>';             content += '<img src='' + product.product_thumbnail_src + ''/>';             content += '<br/>';             $(content).appendTo('#product_list');           });         }); 

    Would take a json object made from a PHP array returned with the key of products. e.g:

    Array('products' => Array(0 => Array('product_title' => 'Product 1',                                      'product_short_description' => 'Product 1 is a useful product',                                      'product_thumbnail_src' => '/images/15/1.jpg'                                     )                           1 => Array('product_title' => 'Product 2',                                      'product_short_description' => 'Product 2 is a not so useful product',                                      'product_thumbnail_src' => '/images/15/2.jpg'                                     )                          )      ) 

    To reload the list you would simply do:

    $('#product_list').empty(); 

    And then call getJSON again with new parameters.

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

Sidebar

Ask A Question

Stats

  • Questions 66k
  • Answers 66k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer First, Python is a language, while ASP.NET is a web… May 11, 2026 at 11:32 am
  • added an answer Creating your own threads in a J2EE application is strongly… May 11, 2026 at 11:32 am
  • added an answer The extra pointer is unnecessary. The array (which basically is… May 11, 2026 at 11:31 am

Related Questions

i am trying to find the best way to display results on my page
I am trying to find the best way to design the database in order
I am trying to find the best practice for generating and outputting html which
I have an interesting query to do and am trying to find the best
I am trying to find the virtual file that contains the current users id.
I am creating a reverse proxy and I am trying to find the optimal
I am trying to find out programatically the max permgen and max heap size
I am trying to find a way to get the source code for (user
I am trying to find an optimal solution for the following problem: there is
I am trying to find a way to have a SELECT statement return the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.