1

Как инициализировать плагин JQuery select2 после его подгрузки через ajax?

1 ответ 1

1
$.ajax({
    //...
    success: function(data){
       //Тут ваш код
       $(selector).select2();
    }    
})

Возможно пригодится jQuery.ajaxSuccess

1
  • К сожалению, данный метод не работает.. $(".editindoc").live("click", function() { var editdocId = $(this).attr("id"); $.ajax({'type':'POST','data':{'id':editdocId},'url':'myurl','cache':false, dataType : "html", success: function (html) { $("#EditIncoming").html(html); $("#Paymants_DocType").select2(); } }); }); Появляется следующая ошибка " undefined' is not a function (evaluating...'
    – skyien
    10 окт 2013 в 9:06

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.