jQuery .load with select2

时间:2015-12-17 12:26:21

标签: jquery jquery-select2

我正在使用JQuery .load将其他页面打开成模态

function LoadModal(page, title) {
    title = title || '';

    $( "#modal_page" ).fadeIn("slow");
    $( "#modal_title" ).html(title);

    $("#modal_page_body").html('<h2 align="center">Loading...</h3><p align="center"><i class="fa fa-refresh fa-spin fa-5x"></i></p>');
    $("#modal_page_body").load(page, function(){

    });
    $("html, body").animate({ scrollTop: 0 }, "slow");
}

我在这里称呼它:

<a href="#" onClick="LoadModal('/section/helpdesk/newticket', 'New Ticket');" title="New Ticket"><i class="fa fa-ticket"></i></a>

我正在使用select2库(select2.github.io),它在我的主页面上工作正常(index.php等),但是它不能用于弹出模式div(当使用JQuery .load时)

其他JQuery函数正常工作,如.autocomplete - 工作正常

1 个答案:

答案 0 :(得分:1)

public class ProgramOnly implements Serializable { /** * */ private static final long serialVersionUID = 75459834905648086L; private String HtmlContent; private Course currentCourse; private Program program; private int videoCount; private int quizCount; private int eLearningCount; private ArrayList<Page> orderedRelatedContent; private String KALTURA_SESSION_KEY; private String KALTURA_PREVIEW_SESSION_KEY; private String videoId; private boolean isPublicAccess; private ArrayList<Document> contentDocuments; private CourseStatusMap courseStatusMap; private CertificateStatusMap certificateStatus; private String programAttendeeId; private String attendeeId; private int pdfCount; private int pptCount; private int htmlCount; private int audioCount; private int interval; private ProgramStatus contentStatus; private String urlForSocialSharing; private boolean isContentMustBePurchased; public Program getProgramSummary() { return program; } //getter setter stuff 的{​​{1}}回调中,您需要调用complete初始值设定项。它不会自动调用动态内容: -

load