You can use .live()
for what you want, like this:
$("#reservationForm").live("submit", function(f){
f.preventDefault();
alert("Jawel");
});
.live()
event handlers work slightly different, they aren't on the elements themselves (it adds a handler to document
), so it can work on future elements added to the page later by listening for their events to bubble up, events bubble the same way, regardless of when the elements were added.
Nick Craver
2010-09-17 09:44:56