I have a little issue here :
I've got a form containing some media due to its widgets.
Everything works as expected when the form is part of the page but if I want to load that form using an ajax call, in a modal for example, even though the js script is included with the form, it's not running. The css is working perfectly fine on the other hand.
I guess this has something to do with javascript not being able to detect a new script tag has been included.
What should I need to do to run this js ?
Code sample :
modal form template :
{{form.media}}
{% crispy form %}
<a class="close-reveal-modal">×</a>
template rendered inside modal :
<div id="level-modal" class="reveal-modal" data-reveal="">
<link href="/static/ajax_upload/css/ajax-upload-widget.css" type="text/css" media="all" rel="stylesheet">
<script type="text/javascript" src="/static/ajax_upload/js/jquery.iframe-transport.js"></script>
<script type="text/javascript" src="/static/ajax_upload/js/ajax-upload-widget.js"></script>
<form id="level-form" class="foundation-form" method="post" enctype="multipart/form-data"></form>
<a class="close-reveal-modal">×</a>
</div>