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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:59:33+00:00 2026-06-11T12:59:33+00:00

maybe this is a too basic question but what is the difference between the

  • 0

maybe this is a too basic question but what is the difference between the .on() event binding in jQuery 1.7+ and 1.8+? My problem is the following:

I am dynamically creating a list with ASP MVC 3 and jQuery Mobile 1.2 RC1 and I bind a click event to the li-elements. If I use jQuery 1.7+ all works fine but when I use 1.8+ the click event is only fired on the first li-element. I have checked the docs of jQuery but actually there should be no difference or?

<ul data-role="listview" id="immo_list" data-inset="true" 
data-theme="c" data-dividertheme="b" data-filter="true">
  <%
      foreach (var immobilie in Model.immoObjekte)
                        {
  %>
      <li id="immos" val="<%: immobilie.id %>"> <a href="">
          <%: immobilie.strasse %> <%:immobilie.hausnummer%></a>
          <span class="ui-li-count"><%:immobilie.id%></span>
      </li> 
  <%
      }
  %>
  </ul>


$('#immo_list').on('click', '#immos', function () {
    $.mobile.loading('show');

    var immoid = $(this).attr('val');
    var days = $("#interval").val();

    sessionStorage.setItem("clicked", "false");
    sessionStorage.setItem("mode", "");

    sessionStorage.setItem("days", days);
    sessionStorage.setItem("immoid", immoid);

    getAndShowPflichten(immoid, days);

});

Thanks for your help!

  • 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-11T12:59:35+00:00Added an answer on June 11, 2026 at 12:59 pm

    You cannot have more than one element with the same ID, it has to be unique. Make #immos a class instead.

    jquery 1.8 includes a new version of Sizzle, their selector engine. As you say it works in 1.7, I guess the new version is stricter in that sense. For performance reasons, Sizzle will stop trawling the document for the element as soon as it finds #immos, as it expects it to be unique.

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

Sidebar

Related Questions

Maybe this is a dumb question, but do event listeners use CPU cycles like
This maybe too basic but I couldn't find an exact answer. I'll be happy
Well, I'm learning Scala so this question may be too basic for most people.
I'm not too great with jquery and maybe this title doesn't explain too well
may be too simple groovy question but....please help i have a list like this:
This may be a silly question, but I'm not all too experienced with iPhone
Maybe this is a poor question, but, I can't find a tutorial or even
This question is so basic that I'm almost embarrassed to ask it, but it's
Maybe this is very basic, but I am all confused. I have a simple
I know this is a basic question, but I can't seem to find an

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.