S
S
sallyruthstruik2013-01-16 13:29:27
Python
sallyruthstruik, 2013-01-16 13:29:27

Ajax authorization?

I'm trying to make authorization through Ajax using ExtJS

Input form:

form = Ext.create("Ext.form.Panel",{<br>
    url: "/login",<br>
    items:[{<br>
      xtype: "textfield",<br>
      name: "login",<br>
      fieldLabel: "Login"<br>
    },{<br>
      xtype: "textfield",<br>
      name: "password",<br>
      fieldLabel: "Password"<br>
    }],<br>
    buttons:[{<br>
      text: "Submit",<br>
      handler: function(){<br>
        if(form.form.isValid()){<br>
          form.form.submit({<br>
            success: function(a,b){<br>
              window.location.reload()<br>
            },<br>
            failure: function(a,b){<br>
              Ext.Msg.alert("Ошибка!", b.result.response)<br>
            }	<br>
          })<br>
        }<br>
      }<br>
    }]<br>
  })<br>

After authorization, I need the page to reload, and using the received cookies, I got into the admin panel. But neither window.location=... nor document.location.href can force the page to reload (and if you update it manually after authorization, then everything works.)

I definitely get into the success event handler (checked)

How can I get out of this situation?

The option "Do not use ajax" is not suitable =)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Paul Smith @Paul, 2013-01-16
@sallyruthstruik

location.reload() 

Tried? without window.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question