Golfers follow the Masters 2011 – but – if you try to access masters.com right now you will get annoying popup messages from your browser telling you that you better stop JavaScript from executing because it takes too long. On my browser this looks like this:

JavaScript makes your browser unresponsive when browsing masters.com
JavaScript makes your browser unresponsive when browsing masters.com

This happens on every page. So – why does that happen?

Endless JavaScript is the problem

I used dynaTrace on both Internet Explorer and Firefox to diagnose this problem. The problem was really easy to spot. Here is the timeline showing me in which JavaScript handler the problem actually happens:

Problem is in the onload event handler triggered by jQuery
Problem is in the onload event handler triggered by jQuery

Double clicking on it brings me to the problematic method – getArraySample that gets called from setChildrenLayout with an empty array:

Passing an empty array but length with value 6 causes the while loop to never end
Passing an empty array but length with value 6 causes the while loop to never end

The problem can be fixed easily by checking the array. I hope this little analysis and recommendation will find the right people to fix this fast – because – Golfers want to see how their players are doing.