Simple W2UI dialog example document body style height 600px let link document createElement link link rel stylesheet link type text css link media all link href https rawgit com vitmalina w2ui master dist w2ui min css document head appendChild link var sciptList https cdnjs cloudflare com ajax libs jquery 3 6 0 jquery min js https rawgit com vitmalina w2ui master dist w2ui min js function loadScripts sc if sc sciptList length 1 main return console log script loaded sc let script document createElement script script type text javascript script src sciptList sc script onload function loadScripts sc 1 document head appendChild script loadScripts 0 function main console log main console log w2popup let button document createElement button document body appendChild button button innerHTML Do Popup button onclick popup end main function popup w2popup open title Popup Title body div class w2ui centered This is text inside the popup div console log finished
eElement script script type text javascript script src sciptList sc script onload function loadScripts sc 1 document head appendChild script loadScripts 0 function main console log main console log w2popup let button document createElement button document body appendChild button button innerHTML Do Popup button onclick popup end main function popup w2popup open title Popup Title body div class w2ui centered This is text inside the popup div console log finished