Hi,
Your two examples are not identical. In the one using 'proyecto'
literally, your if statement will always be true because you're not
using $, you're using
if('proyecto')
where to be identical to the x1 version you would need
if($('proyecto'))
I don't know why that would make any difference since presumably the
element does exist (otherwise the literal example wouldn't work), but
it's a difference.
I'd suggest you take this code:
001: document.observe('dom:loaded', function(){
002: var x1, elm;
003: x1='proyecto';
004:
005: elm = $(x1);
006: if (elm) {
007: elm.observe('change', function(evt) {
008: document.fire('sic:'+x1);
009: });
010: }
011: });
And use a debugger like Firebug or similar to put a breakpoint on line
6 and another one on line 8, and see what you see. Is 'elm' undefined
on line 6? Does document.fire on line 8 get called when the change
happens?
FWIW,
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available
On Jun 27, 2:18 am, "Miguel Beltran R." <[email protected]> wrote:
> 2009/6/26 Tobie Langel <[email protected]>
>
>
>
> > You're missing the semi-colon (":").
>
> > Best,
>
> > Tobie
>
> Is a mistake in the mail but my real function is well formed, see my two
> functions when was copy from original
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---