2009/2/19 Fernando Gabrieli <[email protected]>:
>
> Hello all, first of all thanks for Prototype!
>
> i am getting an error from prototype.js, in function:
>
> function $(element) {
>  if (arguments.length > 1) {
>    for (var i = 0, elements = [], length = arguments.length; i <
> length; i++)
>      elements.push($(arguments[i]));
>    return elements;
>  }
>
>  if (typeof element == 'string')
>    element = document.getElementById(element); <--------- i get the
> error from here
>  return Element.extend(element);
> }
>
>
> It says "Error: Invalid Argument"
>
> dumping element it is an empty string ( element="" )
>
> Do you know what could cause this error ?
>
> Thanks in advance
>
>
> Best Regards,
> Fernando Gabrieli
>
> >
>

Are you using prototype before the DOM has finished loading?

Wrap your code in something like ...

document.observe('dom:loaded',function(){
 // Your code
});

-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to