0
我想改變這個mootools到jquery,但我沒有找到一個等效,問題是在行中:onSuccess:function(texto,xmlrespuesta){$('divrespuesta2').set('html',texto) ;有沒有相當於MooTools的set()的jQuery?
Motools
function searchTopics(){
document.getElementById("divrespuesta3").innerHTML="";
document.getElementById("divInicio").innerHTML="";
buscador = $('txtbuscar').value;
var nuevoRequest = new Request({
method: 'POST',
url: '../path/controller.php',
data: 'search='+search,
onRequest: function() {$('divrespuesta2').innerHTML="Cargando...";},
onSuccess: function(texto, xmlrespuesta) {$('divrespuesta2').set('html',texto);
}
jQuery的
function searchTopics(){
$('#divrespuesta3').html("");
$('#divInicio').html("");
buscador = $('#txtbuscar').val();
$.ajax({
type: "POST",
url: '../path/controller.php',
data:'search='+search,
beforeSend:function(){},
success: function(response){
$('#divrespuesta2').set('html', response);
}
});
}
感謝答案,我已經真正的幫助 –