Q:

JS Error - Unresponsive Script

I am dynamically adding elements to my webpage using the code below. It works, but it freezes the page. Can anyone explain why this would be happening?  
 <script>
            $(function() {
                var ruler = $("#ruler").height();
                var body = $("body").height();
                while (ruler <= body) {
                    $("#rulerStart").append("<div class='lineLarge'></div><div class='lineSmall'></div>");
                };
            });
        </script>

A:

var ruler = $("#ruler").height();
var body = $("body").height();

These values are static. Once set, always set.
You'll need to reset them inside the loop:
$(function() {
    var ruler = $("#ruler").height();
    var body = $("body").height();
    while (ruler <= body) {
        $("#rulerStart").append("<div class='lineLarge'></div><div class='lineSmall'></div>");
        ruler = $("#ruler").height();
        body = $("body").height();
    };
});

