How to display an IFRAME inside a jQuery UI dialog

前端 未结 3 680
盖世英雄少女心
盖世英雄少女心 2020-11-28 04:40

The web application that I am upgrading uses jQuery and jQuery UI. I have replaced most instances of window.open and with j

3条回答
  •  忘掉有多难
    2020-11-28 05:09

    Although this is a old post, I have spent 3 hours to fix my issue and I think this might help someone in future.

    Here is my jquery-dialog hack to show html content inside an '); // create jquery dialog by a 'div' with 'iframe' appended $("

    ").append(wrapperIframe).dialog(modalProperties); // insert html content to iframe 'body' let wrapperIframeDocument = wrapperIframe[0].contentDocument; let wrapperIframeBody = $('body', wrapperIframeDocument); wrapperIframeBody.html(modalHtmlContent);

    jsfiddle demo

提交回复
热议问题