if $('filter_sum') does not exist than the value can not either..
in the original sample sample provided, they tested for $
('filter_sum') befor trying to read $('filter_sum').value
this will not throw an error
if ($('filter_sum')) {
// "filter_sum" exists
alert($('filter_sum').value);
} else {
// "filter_sum" dosn't exist
}
but this would....
if ($('filter_sum').value) {
// "filter_sum" exists
alert($('filter_sum').value);
} else {
// "filter_sum" dosn't exist
}
______________________________________________________________________
Alex Duffield ❖ Principal ❖ InControl Solutions . http://
www.incontrolsolutions.com
On 23-Sep-07, at 5:06 AM, [EMAIL PROTECTED] wrote:
>
> Hello,
>
> thats thows an error
>
> Error: $("filter_suchwort") has no properties
>
> my code is:
>
> var filter = $("filter").value;
>
>
>>
>> var f = $('filter_sum');
>> if (f) {
>> // "filter_sum" exists
>> f.value;
>> } else {
>> // "filter_sum" dosn't exist
>> }
>
>
>
> ____________
> Virus checked by G DATA AntiVirusKit
> Version: AVK 17.8057 from 23.09.2007
> Virus news: www.antiviruslab.com
>
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---