Hi,

Safari's JavaScript engine handles switch just fine as far as I know,
and there's nothing special about the switch being inside the function
you're using for the dom:loaded handler. Since you haven't quoted your
actual code, I don't think folks will be able to help you figure it
out, but my suspicion (with respect) is that there's a syntax error in
one of the conditions you're commenting out when it works -- a
duplicate case, perhaps? Something like that. If you quote the actual
code, we may be able to help you find it.

FWIW,
--
T.J. Crowder
Independent Software Consultant
tj / crowder software / com
www.crowdersoftware.com


On Mar 14, 9:27 am, mikaeru <mika...@gmail.com> wrote:
> Hi, I don't know if it is a bug, but if I have a switch statement with
> more than 2 cases defined.
> safari won't show any javascripts inside the switch body when it is
> used within document.observe("dom:loaded", function() {}
>
> here is my code:
>
> document.observe("dom:loaded", function() {
>
>         //some initializing functions
>
>         switch(x) {
>                 case 'a':
>                                                 brabrabra.....
>                         break;
>                 case 'b':
>                         brabrabra.....
>                         break;
>                 case 'c':
>                         brabrabra......
>                         break;
>         }// end of switch
>
> });
>
> in safari, the function called before the switch will work,
> but all codes inside the switch won't.  But it does work on IE
>
> and if I cut down cases to 2 cases, than it work again on safari.
>
> any help?

-- 
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 prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to