On Dec 5, 4:59 am, yoshi <[EMAIL PROTECTED]> wrote:
> i think u guys are assuming firefox,
No, they're assuming compliance with the ECMAScript specification.
> in IE eval without the function
> wrapped in () does not cause syntax err, and even if i added the '()',
> like
>
> var stuff7=eval('(function() {alert("stuff..");})')
>
> stuff7 is still undefined........according to IE8 beta2's js console
> that is.....
The fact that one particular browser doesn't throw a syntax error
doesn't mean that it isn't one. It is. The language is specified by
ECMA-262, not Microsoft's IE development team.
If you want to create a function from arbitrary code at runtime (and
there are very few reasons to do that), use the Function constructor:
var stuff7 = new Function('alert("stuff..")') ;
--
Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---