1. #1
    Ext User
    Join Date
    May 2008
    Posts
    6
    Vote Rating
    0
    nameroc is on a distinguished road

      0  

    Default Ext.Ajax.request Problem

    Hi,

    I've recently switched to Ext 3 RC 1, and I'm having some issues with Ext.Ajax.request. When I request a file which contains anything BUT JSON formatted data (regular html files, files which contain a <div>, files which contain simple javascript functions), it gives an 'missing (in parenthetical' error in firebug and the request does not complete. This used to work in the previous version of Ext JS.

    I want to request non-json formatted files for my project using Ext.Ajax.request or some other method if that is possible.

    Thanks in advance for any insights or ideas,
    nameroc

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,555
    Vote Rating
    55
    Animal will become famous soon enough

      0  

    Default

    You are passing the result to eval() which is throwing this error.

    Debug by seting a breakpoint in Ext's Ajax postprocessing, and stepping through until you see where the error is.

  3. #3
    Ext User
    Join Date
    May 2008
    Posts
    6
    Vote Rating
    0
    nameroc is on a distinguished road

      0  

    Default

    Thanks for the response, but I'm still confused. Here's the code that errors out:

    Code:
    Ext.Ajax.request({
                    scope : this,
                    url : '/js/ext_components/formlar/' + formName + '.js',
                    success : function(response){                    
                    }
                });
    This is the request that runs. As you can see, the success function is empty and nothing is being done with the response.

    When the url points to a file which contains this:
    Code:
    {json:true}
    It works correctly (as in, no errors in firebug).

    However, when the url points to a file which contains:
    Code:
    json:false
    It gives the
    Code:
     missing ) in parenthetical
    [IMG]chrome://firebug/content/blank.gif[/IMG](json:false)
    error in ext-all-debug.js, line 7570. The line does indeed contain eval(), but I don't get why it's trying to evaluate the result at all.

  4. #4
    Sencha User dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,091
    Vote Rating
    57
    dawesi has a spectacular aura about dawesi has a spectacular aura about

      0  

    Default

    can you show the data you are getting back?
    Lead Trainer / Sencha Specialist
    Community And Learning Systems

    Lead Architect
    DigitalTickets.net

  5. #5
    Ext User
    Join Date
    May 2008
    Posts
    6
    Vote Rating
    0
    nameroc is on a distinguished road

      0  
    Last edited by nameroc; 30 Apr 2009 at 1:12 AM. Reason: image stretched out the forums too much

  6. #6
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,555
    Vote Rating
    55
    Animal will become famous soon enough

      0  

    Default

    Quote Originally Posted by nameroc View Post
    Thanks for the response, but I'm still confused. Here's the code that errors out:

    Code:
    Ext.Ajax.request({
                    scope : this,
                    url : '/js/ext_components/formlar/' + formName + '.js',
                    success : function(response){                    
                    }
                });
    This is the request that runs. As you can see, the success function is empty and nothing is being done with the response.

    When the url points to a file which contains this:
    Code:
    {json:true}
    It works correctly (as in, no errors in firebug).

    However, when the url points to a file which contains:
    Code:
    json:false
    It gives the
    Code:
     missing ) in parenthetical
    [IMG]chrome://firebug/content/blank.gif[/IMG](json:false)
    error in ext-all-debug.js, line 7570. The line does indeed contain eval(), but I don't get why it's trying to evaluate the result at all.
    So set a break there!

    See what it's doing, and why, and see who called it, from where by going back through the call stack.

  7. #7
    Ext User
    Join Date
    May 2008
    Posts
    6
    Vote Rating
    0
    nameroc is on a distinguished road

      0  

    Default

    The error was in my code after all: A catch all requestcomplete that was written ages ago, and I'd forgotten about it.

    Thanks for all the help,
    nameroc

Thread Participants: 2