Jonathan Nixon
Jonathan Nixon

Reputation: 4952

Debugging Javascript hangs system

I am working on a project using MVC and dropdown lists. When the dropdown list changes, I have some javascript code that needs to execute. I started having trouble debugging it (system locked up everytime) so I created a stripped down, simple example to see where the problem is (sample is below).

When I run this code through IE 11, it works just fine. However, when I run this using the IE 11 developer tools (javascript debugger) and place a breakpoint within my select list change function, the debugger and IE hang. Worse, I cannot close them as my system essentially hangs. The only way out is to log off or shutdown the machine manually. Has anyone run into this issue before? I have had 2 developers where I work try this and it breaks for them as well.

Interestingly, this can be debugged just fine in Google Chrome and Firefox.

<script src="~/Scripts/jquery-2.1.0.js"></script>

<script type="text/javascript">
    $(document).ready(function () {
        $("#mySelect")
            .change(function () {
               var x = $(this).val(); // Breakpoint here
                $("#myTextbox").val(x);
            });

        $("#myTextbox")
            .change(function () {
                var x = $("#myTextbox").val();
                alert(x);
            });
    });
</script>

<select id="mySelect">
    <option value="hello">Hello</option>
    <option value="world">World</option>
</select>

<input type="text" id="myTextbox" />

Upvotes: 3

Views: 1705

Answers (1)

Jonathan Nixon
Jonathan Nixon

Reputation: 4952

Update: This issue since been resolved by Microsoft.

https://connect.microsoft.com/IE/feedback/details/812266/whole-of-windows-ui-hangs-when-hitting-a-breakpoint-within-select-onchange-event

It has been resolved by KB2929437 (http://support.microsoft.com/kb/2929437)


This appears to be a known issue according to Microsoft and there are currently no workarounds.

http://connect.microsoft.com/IE/feedback/details/811122/ie-11-dev-tools-bug-related-to-onchange-event-of-select-element

Upvotes: 1

Related Questions