In your first code $('toto') does not exist.....
Alex Mcauley
http://www.thevacancymarket.com
----- Original Message -----
From: "Nicolas Terray" <[email protected]>
To: <[email protected]>
Sent: Thursday, August 06, 2009 12:47 PM
Subject: [Proto-Scripty] dom:loaded & exceptions
>
> Hello,
>
> ---
> <html>
> <head>
> <script type="text/javascript" src="prototype.js"></script>
> <script type="text/javascript">
> document.observe('click', function() { $('toto').update('1 2 3'); });
> </script>
> </head>
> <body>
> </body>
> </html>
> ---
>
>
> If I click on the document, firebug raise the following exception:
> ---
> $("toto") is null
> ---
>
> Great!
>
> Now replace the 'click' event by 'dom:loaded' =>
> ---
> <html>
> <head>
> <script type="text/javascript" src="prototype.js"></script>
> <script type="text/javascript">
> document.observe('dom:loaded', function() { $('toto').update('1 2 3'); });
> </script>
> </head>
> <body>
> </body>
> </html>
> ---
>
> I expect the excepetion being raised during the load of the page.
> However it is caught somewhere and I don't get any excpetion. snif :(
>
> Is something wrong?
> Is there any workaround?
>
> Thanks,
> Nicolas Terray
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---