简体   繁体   中英

Is there a jQuery equivalent of MooTools' set()?

I am trying to change this mootools to jquery but I dont find a equivalent, the problem is in the line: onSuccess: function(texto, xmlrespuesta) {$('divrespuesta2').set('html',texto);

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);

        }
    });


}
$("#divrespuesta2").html(response);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM