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
    Frederick MD, NYC, DC
    Posts
    16,170
    Vote Rating
    32
    jay@moduscreate.com is just really nice jay@moduscreate.com is just really nice jay@moduscreate.com is just really nice jay@moduscreate.com is just really nice

      0  

    Default


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

    Jay Garcia @ModusJesus || Modus Create co-founder
    Ext JS in Action author
    Sencha Touch in Action author

    Get in touch for Ext JS & Sencha Touch Touch Training

    We are also working on Video-based Sencha Touch training: Check it out here.

  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
    Frederick MD, NYC, DC
    Posts
    16,170
    Vote Rating
    32
    jay@moduscreate.com is just really nice jay@moduscreate.com is just really nice jay@moduscreate.com is just really nice jay@moduscreate.com is just really nice

      0  

    Default


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

    Jay Garcia @ModusJesus || Modus Create co-founder
    Ext JS in Action author
    Sencha Touch in Action author

    Get in touch for Ext JS & Sencha Touch Touch Training

    We are also working on Video-based Sencha Touch training: Check it out here.

  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 Premium Member bricemason's Avatar
    Join Date
    Jan 2008
    Location
    Upstate NY
    Posts
    199
    Vote Rating
    27
    bricemason will become famous soon enough bricemason will become famous soon enough

      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
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,754
    Vote Rating
    113
    sven is just really nice sven is just really nice sven is just really nice sven is just really nice sven is just really nice

      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.