I have a problem executing onclose event multiple time on page. I have used handler:iframe to display view in squeezebox modal.
I have written following javascript:-
on child page
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#add_agent").on('click',function (e) {
e.preventDefault();
jQuery('#agentsList input:checked').each(function() {
window.parent.agents.push(jQuery(this).val());
});
window.parent.SqueezeBox.close();
});
});
</script>
on parent page
<script type="text/javascript">
window.agents = [];
window.SqueezeBox.addEvent('onClose',function() {
if(window.agents.length !== 0){
jQuery("#agentChecked").css('display','block');
</script>
onClose event on parent page works fine for the first time. But at second time of closing modal, this event doesn't response.
What should I Do???