$.ajax working with Firefox, not IE

Posted by Isamtron on Stack Overflow See other posts from Stack Overflow or by Isamtron
Published on 2010-05-14T20:05:49Z Indexed on 2010/05/14 20:14 UTC
Read the original article Hit count: 199

Filed under:
|

Hello,

I have a jQuery code to allow users to login using a lightbox (http://colorpowered.com/colorbox/) and immediately start downloading files, without being redirected or having the page reloaded. It's perfectly working in Firefox but Internet Explorer keeps showing the login box until I reload the page :(

<? if (!$this->session->userdata('user_logged_in')): ?>

<script type="text/javascript">
$(document).ready(function() {
    $('a[href^="/link/"]').click(function(event){
        var status = $.ajax({
            url: "/status",
            async: false
        }).responseText;
        if (status != 'USER_LOGGED_IN')
        {
            $.fn.colorbox({href:"/login"});
            event.preventDefault();
        }
    });
});
</script>

<? endif ?>

Your help would be greatly appreciated.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ajax