why it's not redirecting?

why it's not redirecting?

Hi,

I am using the code below to sign in user with ajax and it's working fine when I just user window.location in the success but when I tried to give a condition to check the querystring ["redirect"] it will just stop on the loading animation and do noting.

what's wrong with this code please?

  1. $(document).ready(function(){
  2.     $(function() { $( "#btnSignin" ).button(); });

  3.     $('#btnSignin').click(function()
  4.     {
  5.         $('#waiting').show();
  6.         $('#frmLogin').hide();

  7.         $.ajax
  8.         ({
  9.             type : 'POST',
  10.             url : '<?php echo $_SESSION["domain_name"]; ?>loginmember',
  11.             dataType : 'json',
  12.             data: { email : $('#txtEmailAddress').val(), pwd : $('#txtPassword').val() },
  13.             success : function(data)
  14.             { 
  15.                 if (data.error === true)
  16.                 $('#waiting').hide();
  17.                 // $('#frmLogin').show();
  18.                 if (_GET['redirect']) { window.location = '<?php echo $_SESSION["domain_name"]; ?>biz'; }
  19.                 else { window.location = '<?php echo $_SESSION["domain_name"]; ?>memberhome'; }
  20.             },
  21.             error : function(XMLHttpRequest, textStatus, errorThrown)
  22.             {
  23.                 $('#waiting').hide();
  24.                 $('#frmLogin').show();
  25.             }
  26.         });

  27.         return false;
  28.     });
  29. });