Bug Tracker

Opened 12 years ago

Closed 12 years ago

#10927 closed bug (invalid)

on is not replacing live properly

Reported by: Sap Owned by: Sap
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:

Description

$(document).ready(function(){

$(document).on("click", function(){

if($("#fucsr").attr("id")!="fucsr") {

$('body').append("<input type='text' id='fucsr' name='fucsr' value=/>");

} $("#fucsr").focus();

});

$("#fucsr").on("click", function(){

alert("clicked");

});

});

/*

  • This example is working with live but not with on

*/

Change History (2)

comment:1 Changed 12 years ago by sindresorhus

Owner: set to Sap
Status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

comment:2 Changed 12 years ago by dmethvin

Resolution: invalid
Status: pendingclosed

The example there isn't using event delegation at all. Please ask for help on the forum.

Note: See TracTickets for help on using tickets.