nextapps-de / winbox

WinBox is a modern HTML5 window manager for the web: lightweight, outstanding performance, no dependencies, fully customizable, open source!
Apache License 2.0
6.2k stars 198 forks source link

Scripts in html content of winbox are ignored #178

Open nightrider77 opened 5 months ago

nightrider77 commented 5 months ago

I am getting data ( html + script type="text/javascript" inside it) with ajax request. After this, I create window as the following:

new WinBox( { html: data } );

But all JavaScript code, passed within data parameter, is completely ignored. But html shows correctly.

Why?

nightrider77 commented 5 months ago

It seems to me, .innerHTML doesn't execute scripts inside html. So the only solution is to run scripts inside oncreate event function. This makes switching to this winbox lib very painful...

SamMousa commented 1 month ago

Do the scripts need to interact with the parent page? If not you could just use an iframe instead of ajax.