Rick Salad
Rick Salad

Reputation: 83

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

        }
    });


}

Upvotes: 0

Views: 625

Answers (1)

genesis
genesis

Reputation: 50974

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

Upvotes: 4

Related Questions