2011-08-28 73 views
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); 

     } 
    }); 


} 

回答

4
$("#divrespuesta2").html(response); 
+0

感謝答案,我已經真正的幫助 –

相關問題