是否有一个jQuery等效的MooTools'设置()

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

本文关键字:设置 MooTools jQuery 有一个 是否      更新时间:2023-09-26

我试图将这个mootools更改为jquery,但我没有找到等效的,问题在于: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);