Matt Kruse schrieb: > I was just reading through some of the jQuery code again to better learn its > internals, and I'm not sure why the globalEval function exists in its current > form. > > Whenever I want to eval something in the global context, I always do: > > Function(data)(); > > since the Function constructor doesn't create a closure. This seems much > simpler than the current logic, expecially for Safari - but I admit that I > haven't done much cross-browser checking. Do some browsers not support the > above syntax, or is there some other reason for using the long globalEval > logic? > I guess either that doesn't work cross-browser or noone came up with that solution so far. I haven't seen it, so odds aren't too bad it works. Good to know.
-- Jörn Zaefferer http://bassistance.de _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/