Google Groups

Re: [zombie-js] jQuery.globalEval() throws EvalError


Assaf Jan 3, 2012 8:57 PM
Posted in group: zombie.js
Indeed a bug.

Brian McDaniel is working his magic to fix this:

On Monday, January 2, 2012 at 9:16 AM, Célio Cidral wrote:

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