Skip to main content

Bug Tracker

Side navigation

#5822 closed bug (invalid)

Opened January 15, 2010 02:08PM UTC

Closed October 19, 2010 11:30PM UTC

new Function not allowed after page load in Adobe AIR

Reported by: dmethvin Owned by:
Priority: low Milestone: 1.4.1
Component: ajax Version: 1.4
Keywords: adobe air function load Cc:
Blocked by: Blocking:
Description

http://groups.google.com/group/jquery-en/browse_frm/thread/3f6c8b8e20627861

I think

                                        if ( window.JSON && window.JSON.parse ) {
                                                data = window.JSON.parse( data );

                                        } else {
                                                data = window["eval"]("(" + data + ")");
                                        }

is better than

                                        if ( window.JSON && window.JSON.parse ) {
                                                data = window.JSON.parse( data );

                                        } else {
                                                data = (new Function("return " + data))();
                                        }

because "new Function()" is not allow after page loaded.

from AIR doc) :

Function constructor

Calls to new Function(param, body) can be replaced with an inline

function declaration or used only before the page load event has been

handled.

Attachments (0)
Change History (2)

Changed January 15, 2010 06:37PM UTC by dmethvin comment:1

Instead of giving up on

new Function
perhaps we could just have AIR users define window.JSON? Or define our own jQuery.JSON and use that if window.JSON isn't there, with a default implementation using
new Function
. Is there a way to feature-detect AIR?

Changed October 19, 2010 11:30PM UTC by addyosmani comment:2

keywords: → adobe air function load
priority: majorlow
resolution: → invalid
status: newclosed

Closing as AIR users have a common workaround specifically mentioned in their docs for this. Also there has been no response from the original submitter to questions asked in this ticket 9 months ago (and we've had two releases since). Please feel free to re-open if further information is available or the releases we rolled out do not fix this issue.