i've got a page where the body is dynamically generated/regenerated using ajax with clickable links, using the following snippet to replace the maintext div w/ the output from the ajax.php script:
$('.ajax_link').click(function() { clicked_link_id = $(this).attr("id"); $.ajax({ dataType: "text", type: "POST", url: "ajax.php", data: "a=" + clicked_link_id, success: function(msg) { $("#maintext").fadeOut("slow", function() { document.getElementById('maintext').innerHTML = msg; $("#maintext").fadeIn("slow"); }); }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert("Error:"); } }); return false; }); sometimes the page info returned from ajax.php (and thus displayed in the maintext div) itself contains an ajax clickable link. when this link is clicked, however, instead of being correctly 'intercepted' by the ajax snippet above, instead attempting to actually load the link specified in the href parameter in the browser (which i've set to #, since i want jquery to handle the link). any help would be appreciated. thanks, -ray