object expected 
Author Message
 object expected

i have this script
<script language="javascript">

<!--
function hideall() {
document.links.[1].disabled = true
document.links.[2].disabled = true

Quote:
}

end function
//-->

</script>
actually i want to disabled the link............
i get "object expected" line 23 which is at end function line.
when i delete the end funtion, the same error come out......
i try many ways such as
document.links.linkname.disabled = true
document.links.linkname.style.disabled = true
but.i still cannot disabled the link........

i want the link will disabled when the page onload.
so, when page onload i call hideall function.

Can anybody give me some idea?
thx........



Tue, 05 Oct 2004 16:38:35 GMT  
 object expected
    document.links[1]....
not document.links.[1]....

BTW, DOM collections are zero-based, so this won't disable the first link,
but the second one. (And if there are only two links on the page, trying to
disable document.links[2] will throw an "object expected" error.)

--
Anyone can do any amount of work provided it isn't the work he is supposed
to be doing at the moment. -Robert Benchley

=-=-=
Steve
-=-=-


Quote:
> i have this script
> <script language="javascript">

> <!--
> function hideall() {
> document.links.[1].disabled = true
> document.links.[2].disabled = true
> }
> end function
> //-->

> </script>
> actually i want to disabled the link............
> i get "object expected" line 23 which is at end function line.
> when i delete the end funtion, the same error come out......
> i try many ways such as
> document.links.linkname.disabled = true
> document.links.linkname.style.disabled = true
> but.i still cannot disabled the link........

> i want the link will disabled when the page onload.
> so, when page onload i call hideall function.

> Can anybody give me some idea?
> thx........



Tue, 05 Oct 2004 18:21:50 GMT  
 object expected
tq steve......
i'll try it.........

Quote:
>     document.links[1]....
> not document.links.[1]....

> BTW, DOM collections are zero-based, so this won't disable the first link,
> but the second one. (And if there are only two links on the page, trying
to
> disable document.links[2] will throw an "object expected" error.)

> --
> Anyone can do any amount of work provided it isn't the work he is supposed
> to be doing at the moment. -Robert Benchley

> =-=-=
> Steve
> -=-=-



> > i have this script
> > <script language="javascript">

> > <!--
> > function hideall() {
> > document.links.[1].disabled = true
> > document.links.[2].disabled = true
> > }
> > end function
> > file://-->

> > </script>
> > actually i want to disabled the link............
> > i get "object expected" line 23 which is at end function line.
> > when i delete the end funtion, the same error come out......
> > i try many ways such as
> > document.links.linkname.disabled = true
> > document.links.linkname.style.disabled = true
> > but.i still cannot disabled the link........

> > i want the link will disabled when the page onload.
> > so, when page onload i call hideall function.

> > Can anybody give me some idea?
> > thx........



Fri, 08 Oct 2004 08:42:59 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Error: Object expected

2. AOL 5 and object expected error

3. vbscript from jscript, object expected?

4. Alert function - exception - Object Expected.

5. Non finish comment & object expected : Going crazy

6. Object expected error

7. Object Expected Error

8. object expected

9. Object Expected

10. Error: Object expected... in 95

11. Object Expected error

12. Error: Object expected

 

 
Powered by phpBB® Forum Software