|
|
 |
Re: FN-FORUM: iframes, was: site check please
date posted 14th May 2007 14:13
Ben Johnson (Neogic) F wrote:
> Phil wrote:
>> Nice. Just a couple of points though, is $() defined somewhere else as
>> something doing getElementById()? And are the three equals signs together
>
>> a typo (on the line "if(sTmp==='')") ?
>
>
> $ is a commonly defined (but not built-in) Javascript function that acts as
> a shortcut to getElementById().
It actually does more. Elements returned by getElementByID are not
extended in the way those elements returned by $() are.
Using the prototype js this would not work:
e=document.getElementByID('somediv');
e.hide();
This would:
e=$('somediv');
e.hide();
But this last example can be done better if e is not to be used again:
$('somediv').hide();
Regards
Richard
--
Artumi Systems, 58 Salmon Street, Sheffield, S11 8DD.
Tel 0114 250 7654, Web http://www.artumi.com
VAT Reg 889 0317 88
|
 |
|