I might be missing something, but this seems like a case where you
would want to do this:

(new Function("alert('iesucks')"))()

it's a little cleaner that way too.

--John

On 4/14/07, Diego A. <[EMAIL PROTECTED]> wrote:

And for those who don't get what's going on...

eval("function(){alert('iesucks')}")
creates a function, but doesn't execute it.

eval("function(){alert('iesucks')}()")
creates the function and executes it immediately...

On Apr 14, 6:49 pm, "Matt Kruse" <[EMAIL PROTECTED]> wrote:
> On Apr 14, 12:42 pm, "Daemach" <[EMAIL PROTECTED]> wrote:
>
> > IE doesn't seem to like to eval anonymous functions.  Is there a way
> > around this other than to strip the function wrapper?
> > eval("function(){alert('iesucks')}")()
>
> Why not this instead?
>
> eval("(function(){alert('iesucks')})()");
>
> Matt Kruse


Reply via email to