JS: window.myid and document.myid

George Staikos staikos at kde.org
Tue Jun 17 18:47:12 BST 2003


On Tuesday 17 June 2003 13:22, Koos Vriezen wrote:
> On Sun, 15 Jun 2003, George Staikos wrote:
> > On Sunday 15 June 2003 08:25, Koos Vriezen wrote:
> > > Hi,
> > >
> > > Shouldn't tags like <OBJECT ID='myid'> also be found with document.myid
> > > (currently in HEAD only window.myid works)?
> >
> >    It seems that at least some sites expect the object id to be a child
> > of the document node.  I saw this recently as well.
>
> Did some testing today with
>
>   <html><head><script>
>   function showIt() {
>     var str = "document.mytable=" + document.mytable + "\n";
>     str += "window.mytable=" + window.mytable + "\n";
>     alert (str);
>     var str = "document.myobj=" + document.myobj + "\n";
>     str += "window.myobj=" + window.myobj + "\n";
>     alert (str);
>     var str = "document.myemb=" + document.myemb + "\n";
>     str += "window.myemb=" + window.myemb + "\n";
>     alert (str);
>   }
>   </script></head>
>   <body onClick="showIt()"><table id="mytable"></table>
>   <object id="myobj"></object><embed id="myemb"></embed>
>   </body></html>
>
> And it seems konqueror is the only one not supporting document.id on
> OBJECT. Don't know why IE doesn't support it on EMBED but I've seen
> document.id on EMBEDs too IIRC, maybe because in this test it has no
> servicetype set.
>
>                       window.id                 document.id
> konqueror 3.1.2   mytable/myobj/myembed               -
> IE 6              mytable/myobj/myembed            myobj
> Mozilla 1.3               -                     myobj/myembed
>
> I think it's good to support document.id on OBJECT and at least APPLET
> elements too (see attached patch).

  I definitely think this should go in, as well as get backported.

-- 
George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/





More information about the kfm-devel mailing list