[jQuery] Stack Overflow at line 0

[jQuery] Stack Overflow at line 0


I "occasionally" get this error in IE8 when refreshing a page. The
debugger is locked out making it difficult to identity the cause.
There's a snippet of code I am using to preload images which when I
borrowed it, mentioned this problem. I've posted it below.
Any suggestions on how this code might be involved with the problem
and how it might be resolved?
$(window).bind('load', function() { // sequentially preload quiz
images after page loads
    var preload = [];
    for (var i=0; i< aQL; i++) { //
        preload.push( [aQuizLib[i][ true ], 'imgQ'+i]);
        preload.push( [aQuizLib[i][ false ], 'imgA'+i]);
    }
    $('img#preLoadQ').bind('load', function() {
        if(preload[0]) {
            var aNextP = preload.shift(); //
            this.src = aNextP[0];
            $('<img />').attr( { 'id': aNextP[1], 'src': aNextP[0], 'alt': '
', 'width': 150, 'height':150 } ).appendTo('#imgBlock'); // This is
unnecessary but gives an excellent html trail for support purposes
        }
    }).trigger('load'); // 1st instance of load must be triggered
});























    • Topic Participants

    • sam