Results 1 to 2 of 2

Thread: Ext.Ajax.Request not working in browser

  1. #1
    Sencha User
    Join Date
    Jul 2013
    Posts
    3

    Default Ext.Ajax.Request not working in browser

    It works fine when I test my application on devices and on the xcode simulators but in web browsers such as Chrome and Safari, the failure function gets called. I don't think the Same-Origin Policy applies here because I tried doing the same thing using jquery's $.ajax and it worked fine.

    here is my code :

    Code:
    // send ajax request
            Ext.Ajax.request({
                url: 'http://testapp.cloudapp.net/index.php/api/accounts/login/',
                method: 'POST',
                params: {
                    username: Ext.getCmp('username').getValue(),
                    password: Ext.getCmp('password').getValue()
                },
                dataType: 'json',
                success : function(response, request) {
                    if(response.responseText == true) {
                        Ext.Msg.alert('validated');
    
    
                        // animate to wall view
    					Ext.Viewport.animateActiveItem(targetView, { type : 'fade' } );
    
    
    					//destroy Login and Register Views
    					var vwRegister = Ext.ComponentQuery.query('register')[0],
    						vwLogin = Ext.ComponentQuery.query('login')[0];
    
    
    					setTimeout( function() {
    						vwRegister.destroy();
    						vwLogin.destroy();
    					}, 2000);
                    }
                    else {
                        Ext.Msg.alert('invalid user');       
                    }
                },
    
    
                failure: function(response, request) {
                	Ext.Msg.alert('error');
                }
            });

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    What http status code is being return from the server? 200? 400? 500? etc?
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •