This is a migrated thread and some comments may be shown as answers.

Script is executed inside window's <div> during window creation

0 Answers 25 Views
Window
This is a migrated thread and some comments may be shown as answers.
Volodymyr Oliinyk
Top achievements
Rank 1
Volodymyr Oliinyk asked on 13 Apr 2012, 02:34 PM
Hello,

I have a code like this:
<div id="wnd1">
    <div>Click me!</div>
    <script type="text/javascript">alert('executed 1');</script>
</div>
 
<script type="text/javascript">
    (function ($) {
        $("#wnd1").kendoWindow({
            height: "500px",
            width: "400px",
            modal: true,
            draggable: true,
            resizable: false,
            visible: false
        });
    })(jQuery);
</script>

And in this case alert is executed twice. First time because of initial script rendering and second when window is initialized.
Should it be such case and how to prevent it?

Also I can see this window during the second alert, is it ok that window shows and hides when "visible: false"?

Vladimir

No answers yet. Maybe you can help?

Tags
Window
Asked by
Volodymyr Oliinyk
Top achievements
Rank 1
Share this question
or