1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    10
    Vote Rating
    0
    ghyster is on a distinguished road

      0  

    Default AIR : Ext.Ajax.request not working

    AIR : Ext.Ajax.request not working


    I'm trying to build an AIR app to access remote data but Ext.ajax.request fails :

    "Error: Adobe AIR runtime security violation for JavaScript code in the application security sandbox (eval)"

    I looked into the ExtDocs AIR app and saw that there was a call to http://extjs.com/playpen/api.php when searching in the API (using an HttpProxy)

    How does it work ?

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    you'll have to use scriptag proxy to do cross-domain requests.

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    10
    Vote Rating
    0
    ghyster is on a distinguished road

      0  

    Default


    cross-domain requests are allowed in AIR apps (eg the ExtDocs app)

    the eval function is not allowed and I wondered how Jack make ajax requests work in the ExtDocs app

  4. #4
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    crap, you're right. I have little experience with air.

  5. #5
    Sencha User Phunky's Avatar
    Join Date
    Jun 2007
    Location
    West Yorkshire
    Posts
    341
    Vote Rating
    0
    Phunky is on a distinguished road

      0  

    Default


    Does the new version of Ext get around this?!

  6. #6
    Sencha User bricemason's Avatar
    Join Date
    Jan 2008
    Location
    Upstate NY
    Posts
    280
    Vote Rating
    44
    bricemason has a spectacular aura about bricemason has a spectacular aura about bricemason has a spectacular aura about

      0  

    Default AIR sandboxes for AJAX development

    AIR sandboxes for AJAX development


    You might be interested in this blog series I did which outlines how to use Ext in an AIR app. It all comes down to Adobe's security model. Here's the link, it's a five part series but the first part may be all you need as it contains links at the bottom to Adobe docs:

    http://dev.aol.com/blog/bricemason/a...syncing-part-1

  7. #7
    Ext User
    Join Date
    Mar 2007
    Posts
    10
    Vote Rating
    0
    ghyster is on a distinguished road

      0  

    Default


    thanks bricemason for your article,

    however I found that the ajax request worked well, the problem was I used Ext.decode to decode the response, the security issue was there

  8. #8
    Ext User
    Join Date
    Nov 2007
    Posts
    102
    Vote Rating
    0
    RobSmith is on a distinguished road

      0  

    Default


    How did you work around the decode issue? I also want get the response as JSON and actually need to decode it.

  9. #9
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Eval with a JSON string is allowed in air 1.0.

    if you need more "eval" set up the browser sandbox by using an iframe

  10. #10
    Ext User
    Join Date
    Nov 2007
    Posts
    102
    Vote Rating
    0
    RobSmith is on a distinguished road

      0  

    Default


    Thanks for reply, I only need JSON evaluation.