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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:36:00+00:00 2026-06-16T17:36:00+00:00

Adding dynamic option to JQM listview was successful in page1 . After adding it,

  • 0

Adding dynamic option to JQM listview was successful in page1. After adding it, listview was refresh:

$('#list').listview('refresh');

Options was linked to page2. In page2 I have pagebeforeshow event:

$('#page2').live('pagebeforeshow', function (e, data) {
    alert(data.prevPage.attr('id'));
});

data.prevPage.attr('id') is undefined when the option selected was the one added dynamically. But for the other option, no problem at all.

Why can’t I get page1 id when selecting dynamically added option in listview?

  • 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-16T17:36:01+00:00Added an answer on June 16, 2026 at 5:36 pm

    Your code should work, take a look at this example: http://jsfiddle.net/Gajotres/c2dU4/. I have recreated your case and everything is working just fine.

    Example:

    $('#index').live('pagebeforeshow',function(e,data){    
        $('#custom-list').append('<li><a href="#second">Link 4</a></li>');
        $('#custom-list').listview('refresh');
    });
    
    $("#second").live('pagebeforeshow', function (e,data) {
        alert(data.prevPage.attr('id'));
    });
    

    Are you maybe trying to pass some additional data through a href? And can you show us more of your code?

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

Sidebar

Related Questions

I have this code for managing dynamic collection List, which is mostly inspired with
I have a panel, where my program is adding dynamic controls. Either I want
I have a dynamic form that is generating a country list. My problem is
I have a jQuery script for adding dynamic content inside containerDivs. http://jsfiddle.net/Lijo/srFkJ/2/ This div
I got a query regarding adding dynamic buttons with dynamic onclick events on a
I'm trying to create a supervisor which handles adding dynamic gen_servers. for a reason
How would I go about adding a dynamic .......... to a restaurant menu in
I am running dynamic queries based on adding removing fields to categories. Here is
I've got some dynamic created buttons in my GridView (adding them OnDataBound), but when
Adding Exceptional Handling is a good practise, but I have a doubt, In our

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.