Есть ли jQuery-эквивалент набора MooTools ()? - PullRequest
0 голосов
/ 29 августа 2011

Я пытаюсь изменить этот mootools на jquery, но я не могу найти эквивалент, проблема в строке: onSuccess: function (texto, xmlrespuesta) {$ ('divrespuesta2'). Set ('html', текст);

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

        }
    });


}

1 Ответ

4 голосов
/ 29 августа 2011
$("#divrespuesta2").html(response);
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...