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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:48:55+00:00 2026-06-09T17:48:55+00:00

I have a list of items that is dynamically pulled from a web service.

  • 0

I have a list of items that is dynamically pulled from a web service.
It looks like this:

https://i.stack.imgur.com/VfXih.png

What I want to happen, is I want the list item that is clicked, to somehow be declared as a variable….and the information for the clicked item, to be passed onto another page. I have no idea how to go about doing this, and was hoping someone here can point me in the right direction.

So far I have been able to come up with this, but the variable ‘someData’ keeps coming back undefined.

$('#dogs ul').click(function(e) {
var someData = jQuery(this).data('<li>');
alert(someData);
});

}

Here is the code that brings all the information together into the listview:

$(data).find('NewDataSet').each(function(i) {
    var listView = $('<ul data-role="listview" data-inset="true" data-split-theme="b">').data('role', 'listview');

    $(data).find('Table').each(function() {
        var title = $(this).find('ShortDesc').text();
        var description = $(this).find('LongDesc').text();
        var thumbnail = $(this).find('ThumbURL').text();
        var listItem = $('<li/>');
        $('<a href="#"><img id="bla" src="' + thumbnail + '"><div id="desc"><h4>' + title + '</h4> <p> <br/>' + description + '</p></div>').appendTo(listItem);
        $(listItem).appendTo(listView);
    });

    $(listView).appendTo('#dogs');
});


$('#dogs ul').listview();

If anyone could point me in the right direction, or show me what I’m doing wrong it’d be greatly appreciated.

Thanks!

  • 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-09T17:48:56+00:00Added an answer on June 9, 2026 at 5:48 pm

    I think you’re pretty close. You can store the data on each li element as they are created using jQuery.data().

    $(data).find('Table').each(function() {
    
        //...
    
        var tableData = $(this); // 'this', in your example, refers to the Table data
        var listItem = $('<li/>').data('TableData', tableData);
    });
    

    To get it back out and pass it along to another page, you can handle the click and post the data to another page. You can also append the data in the querystring if that’s easier.

    $('#dogs ul li').click(function(e) {
        e.stopPropagation();
        var tableData = $(this).data('TableData');
        $.mobile.changePage("anotherpage.php", {
            type: "post",
            data: $(tableData).serialize() // I'm not sure of your data format, so serialize() this may not work
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of items that are displayed using a ListView from a
I have a list of items that are created from the results of website
I have a List that contains items, for example: 1) https:\\10.12.23\\ 2) https:\\12.23.12.25\\ 3)
I have a list of items on my web page that the user can
I have a list of tab items that have views dynamically added to them.
So I have a to-do list of items that are dynamically populated by user
I have a list of items that I need to update on different intervals.
I have a list of items that a user can add to by clicking
I am creating an application that will have a list of items that can
I have a dynamic list of items that will be used to POST information

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.