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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:30:35+00:00 2026-05-23T13:30:35+00:00

I have a JSon array that displays in a JQuery Mobile list. It shows

  • 0

I have a JSon array that displays in a JQuery Mobile list. It shows the description + price, but I’d like to add a picture Icon to the left.

Any pointers on how I could achieve that ?
Can I add an image tag to the “brand” ? Brand is where I’d like the image to display.

Thanks !

Here’s my code.

// Json array
var productList = {"products": [
    {"brand": "brand1", "description": "Product 1", "price": "03.25 "},
    {"brand": "brand2", "description": "Product 4", "price": "01.10 "},
    {"brand": "brand3", "description": "Product 3", "price": "04.21 "},
    {"brand": "brand4", "description": "Product 2", "price": "15.24 "},
    {"brand": "brand5", "description": "Product 5", "price": "01.52 "},
    {"brand": "brand6", "description": "Product 6", "price": "12.01 "},
    {"brand": "brand7", "description": "Product 7", "price": "05.24 "}

] };

// Name Descending

function loadList() {

var list = $("#productList").listview();

var prods = productList.products.sort(function(a, b) {return a.description > b.description;});
$.each(prods, function() {
list.append("

  • " + this.description + "  :       " + this.price + "
  • ");
    });

    // CALL SORT BY NAME DESCENDING
    $(function(){
    

    $("#sort-list").click(loadList2);
    });

    $(list).listview("refresh");

    }

    • 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-23T13:30:35+00:00Added an answer on May 23, 2026 at 1:30 pm

      You’re writing out an HTML list derived from a JSON array. So, one suggestion for achieving what you want:

      1. Modify the JSON produced so that instead of the brand text you have in there at the moment, you provide the URI for the relevant image
      2. Modify the loadList() function so that you write out an img tag as part of your HTML, using the URI passed-in from your JSON as that image tag’s src attribute.
      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
        • Report

    Sidebar

    Related Questions

    I have a jquery auto complete script that takes a JSON array and displays
    Hi I have a JSON object that is a 2-dimentional array and I need
    I have a php file somejson.php that echos a json encoded array {jsonone:first json,jsontwo:second
    I have a JSON array like this: { forum:[ { id:1, created:2010-03-19 , updated:2010-03-19
    I have an array of json objects like so: [{a:b},{c:d},{e:f}] What is the best
    I have an array of data that is returned as a JSON response. The
    I know that this question might have been asked like 100 times, but, believe
    I have a jquery function that request data typed json. The data I requested
    I have a multi-dimensional associative array that is encoded into JSON for database storage,
    I have 2 classes that return a json encoded array if an error message

    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.