What is an equivalent jQuery implementation of this Prototype Ajax.Updater call?
How would you create the same implementation in jQuery?
<a href="#" onclick="new Ajax.Updater('input_123',
开发者_如何学JAVA'/record/123',
{asynchronous:true, evalScripts:true}); return false;">
Bind jQuery $.ajax to your 'a' tag.
$(document).ready(){
$('a#ajax').click(function(event){
event.preventDefault();
$.ajax('/process.php', data);
});
}
$(function(){
$('a').click(function(e){
$('#input_123').load('/record/123');
e.preventDefault();
});
});
I've never worked with prototype, but that's my best guess. probably best to give your anchors an id, and use that to attach the behaviour though.
this is assuming that input_123 is the id of a something and what get's returned from /record/123 is html that goes in there...
精彩评论