[jQuery] Applying event handler to .load-ed content
Hi all,
Reading through the archives I have found out why I can't apply the
click function to content I have added via .load - however I can't get
any of the solutions to work! (And I don't fully understand them which
doesn't help either!)
In simple terms, does anyone have a way for a newbie to re-apply event
handlers to content that's been called via .load?
Here's what I have:
// Search button has been clicked - let's do some AJAX, baby!
$("#searchbutton").click(function(){
$("#animal_table").slideUp("slow");
$("#animal_table").load("/includes/catalogue/getlots.php",{
start: "0",
show: "200",
year: "<?php echo $thispage['year']; ?>",
sire_id: document.getElementById("sire_id").value,
horn: document.getElementById("horn").value,
ss: document.getElementById("ss").value,
milk: document.getElementById("milk").value,
ci: document.getElementById("ci").value,
ebv200d: document.getElementById("ebv200d").value,
ebv400d: document.getElementById("ebv400d").value,
ebv600d: document.getElementById("ebv600d").value,
text: document.getElementById("text").value
},function(){
$("#animal_table").slideDown("slow");
$(document).ready(); // my dumb hack which doesn't work
});
});
Cheers!
Jason
--
Jason Foss
http://www.almost-anything.com.au
http://www.waterfallweb.net
Windows Messenger: jason@almost-anything.com.au
North Rockhampton, Queensland, Australia
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/