Giter VIP home page Giter VIP logo

Comments (9)

Somebi avatar Somebi commented on May 18, 2024

+1 please fix that.

from jquery-tmpl.

BorisMoore avatar BorisMoore commented on May 18, 2024

Do you mean that any js file that is loaded in the browser, and which uses new Function() in the context of an AIR application will fail? That's a big restriction to put on all javascript platforms. Even jQuery itself uses it (in parseJSON).

Or is it some error arising in the specific instance of a call to new Function() in buildTmplFn? In that case, does the error occur no matter what template you are using?

from jquery-tmpl.

tommoor avatar tommoor commented on May 18, 2024

Unfortunately this restriction is very real, and very frustrating:

See official documentation:
http://cookbooks.adobe.com/post_Avoid_JavaScript_security_errors_in_the_AIR_applic-8083.html

Any suggestions on how to overcome this?

from jquery-tmpl.

BorisMoore avatar BorisMoore commented on May 18, 2024

Does $.parseJSON(...) also generate a violation?

from jquery-tmpl.

jzaefferer avatar jzaefferer commented on May 18, 2024

$.parseJSON uses JSON.parse when available, which is probably the case in Adobe AIR.

from jquery-tmpl.

tommoor avatar tommoor commented on May 18, 2024

parseJSON seems to work fine.

We are still using jquery-tmpl, the work around has been to compile all of the templates when the application starts, before the body onload event as obviously it is only the compilation that generates the sandbox violation.

from jquery-tmpl.

jzaefferer avatar jzaefferer commented on May 18, 2024

Could you clarify what "when the application starts" means? Is that an acceptable workaround, or is this issue still big enough that it should be resolved within the template plugin?

from jquery-tmpl.

tommoor avatar tommoor commented on May 18, 2024

when the application starts means before the onload event.

Is it an acceptable workaround? Probably not.
Is it a problem for the jquery-tmpl team? Probably not.

Unfortunately it's an inherent limitation of Adobe Air, and on reflection it probably isn't worth the time figuring out a fix.

from jquery-tmpl.

BorisMoore avatar BorisMoore commented on May 18, 2024

Closing issue for now.

from jquery-tmpl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.