JavaScript won't work unless I use alert()!
<p>I run into this issue from time to time and I don't know how to solve it. Here's my code that fails:</p>

<pre><code>function on_lightbox_open() {

    system.contextBrowserInit();

    updateUrl(year + '/' + month + '/' + id);
    ads.reload();
    system.analytics.reload();

    FB.XFBML.parse($('#bottom_flap .fb_like').get(0)); // facebook
    $.ajax({ url: 'http://platform.twitter.com/widgets.js', dataType: 'script', cache: true });

    $('#lightbox .close').live('click', function(){
        $.modal.close();
    });
}
</code></pre>

<p>If I add an alert at the begining like so:</p>

<pre><code>function on_lightbox_open() {

    alert('i work now');

    system.contextBrowserInit();

    updateUrl(year + '/' + month + '/' + id);
    ads.reload();
    system.analytics.reload();

    FB.XFBML.parse($('#bottom_flap .fb_like').get(0)); // facebook
    $.ajax({ url: 'http://platform.twitter.com/widgets.js', dataType: 'script', cache: true });

    $('#lightbox .close').live('click', function(){
        $.modal.close();
    });
}
</code></pre>

<p>It magically works. How to make it work without an annoying random alert?   </p>
