Results 1 to 7 of 7

Thread: Ext.Ajax.request in firefox

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    4

    Default Ext.Ajax.request in firefox

    Hello everyone

    I want to execute the following code in firefox
    HTML Code:
    Ext.Ajax.request({
    url: "http://localhost:1979/geoserver/j_spring_security_check?",
    method: "POST",
    scriptTag: true,
    params: {
        username: username,
        password: password
    },
    success: function () {
        alert("ok");
    }
      }); 
    For some reason this snippet of code is never executed in firefox or chrome (in ie works fine)

    thanks in advance

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791

    Default

    Could you let us know which framework version you're using so that we can move your question to the appropriate forum?

  3. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    4

    Default

    sure, I'm using .net 4.0 in asp.net with c#

  4. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791

    Default

    Which ExtJS version?

  5. #5
    Sencha User
    Join Date
    Jun 2012
    Posts
    4

    Default

    ExtJS 3.4.0

  6. #6
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409

    Default

    If you enter the command in the console, do you get anything?
    (ext will have to be loaded of course, and params cleared)

    If you enter the URL in a browser?, do you get a response?

    Scott.

  7. #7
    Sencha User
    Join Date
    Jun 2012
    Posts
    4

    Default

    I run my code in asp.net, this is my entire code (I added some modifications)

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <script type="text/javascript" src="Scripts/geoext/ext-base.js"></script>
            <script type="text/javascript" src="Scripts/geoext/ext-all.js"></script>
            <link rel="stylesheet" type="text/css" href="Styles/geoext/ext-all.css" />
            <link rel="stylesheet" type="text/css" href="Styles/geoext/examples.css" />
            <script type="text/javascript" src="Scripts/geoext/OpenLayers.js"></script>
            <script type="text/javascript" src="Scripts/geoext/GeoExt.js"></script>
            <script type="text/javascript">
                function logueoGeoServer() {
                    var user = document.getElementById("name");
                    var pass = document.getElementById("password");
                    Ext.Ajax.request({
                        async: false,
                        url: "http://localhost:1979/geoserver/j_spring_security_check",
                        method: "POST"
                        ,
                        params: {
                            username: "admin",
                            password: "geoserver"
                        },
                        success: function () {
                            alert("ok");
                        },
                        failure: function () {
                            alert("failure");
                            console.log(arguments);
                        }
                    }); 
                }
                
            
            </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        
        <input type="submit" onclick="logueoGeoServer(); return false;"/>
        
        
        </div>
        </form>
    </body>
    </html>
    I always enter in the failure section of my Ext.Ajax.request (I use firebug as debugger) the "arguments" parameter returns a statusText="communication failure", this only happen in firefox and chrome, in explorer everything works fine and I get the "ok" message

    Thanks in advance

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
  •