Error in jquery ajax() method?
<p>To redirect current page I use <code>window.document.location()</code> statement inside the <code>ajax()</code> function. But it is showing error(in firebug). There is no error in functionality request is going and response is comming properly. <code>window.document.location('user/index.php');</code> statement creating the problem. How can I redirect this page to another if the <code>msg=='YES'</code>?</p>

<pre><code>$.ajax({
          url:  "user_registration.php",
          type: "post",
          data: datastring,
          success: function(msg) {
              if(msg=='YES') {                                  
                   window.document.location('user/index.php');
              }
              else
                   $("#success").html(msg);
        }
   });
</code></pre>
