jQueryで同じ実装をどのように作成しますか?このPrototype Ajax.Updaterコールの同等のjQuery実装は何ですか?
<a href="#" onclick="new Ajax.Updater('input_123',
'/record/123',
{asynchronous:true, evalScripts:true}); return false;">
jQueryで同じ実装をどのように作成しますか?このPrototype Ajax.Updaterコールの同等のjQuery実装は何ですか?
<a href="#" onclick="new Ajax.Updater('input_123',
'/record/123',
{asynchronous:true, evalScripts:true}); return false;">
バインドjQuery $.ajaxを 'a'タグにバインドします。
$(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();
});
});
私はプロトタイプで働いたことがありませんが、それは私の最高の推測です。おそらくあなたのアンカーにIDを与え、それを使って動作を添付するのが最も良いでしょう。
これはinput_123が何かのIDであり、/ record/123から返されるものがそこに入るhtmlだと仮定しています...