jQuery.globalEval() throws EvalError

124 views
Skip to first unread message

Célio Cidral

unread,
Jan 2, 2012, 12:16:19 PM1/2/12
to zomb...@googlegroups.com
This happened to me after I tried to call jQuery.load():

   EvalError: The “this” object passed to eval must be the global object from which eval originated.

The response html contained a <script> block which jQuery tried to evaluate with jQuery.globalEval().  I'm not sure why this happens but I guess the eval() function is does not recognize window as a valid global context.  I tried to workaround it by replacing the line window["eval"].call(window, data) with simply eval(data) and it worked.  Of course this workaround is by far unrecommended.

Does anyone have some hint on this problem?

Célio

Assaf Arkin

unread,
Jan 3, 2012, 11:57:46 PM1/3/12
to zomb...@googlegroups.com
Indeed a bug.

Brian McDaniel is working his magic to fix this:

Célio Cidral

unread,
Jan 20, 2012, 7:51:41 AM1/20/12
to zomb...@googlegroups.com
Seems like it's been fixed.  Thanks a lot for your help.

Célio
Reply all
Reply to author
Forward
0 new messages