JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
JavaScript
open_popup()
function open_popup() {
var divExists = $("#popup_traceurs").length;
if (divExists) {
$( "#popup_traceurs" ).remove();
open_popup();
}
else
{
var popup_traceurs = "<div id='popup_traceurs'></div>";
//Create dialog (jquery-ui)
var input_link = "https://lh3.ggpht.com/8s1ii0TiD8TLLgmLEvAhYoDMfGsd4upbck7L7SF1Ja_b-HyfTcaEL3GrnmEm4TQDNx0=w300";
var iframe = $('<iframe></iframe>');
iframe.attr({
src: input_link,
backgroundColor: "white",
id: "iframe_traceurs"
});
//iframe = iframe[0];
//iframe.width = iframe.contentWindow.document.body.scrollWidth;
//iframe.height = iframe.contentWindow.document.body.scrollHeight;
var dialog = $(popup_traceurs).append(iframe).dialog(
{
modal: true,
height: "auto",
width: "auto",
resizable: false,
autoOpen: false
});
dialog.dialog("open");
$("#popup_traceurs")[0].style.backgroundColor = "white";
}
};