[webkit-dev] Reg. Direct DOM access without getElementById fails....

Charles Pritchard chuck at jumis.com
Thu Dec 8 02:39:04 PST 2011


They're accessed via the window object in the global scope.
I believe there is a slight compatibility issue between webkit 
distributions for
<script>window.myvar = function() {}</script><!-- followed by -->
<div id="window.myvar"></div>, given that it would map to 
"window.window.myvar".

But nobody does that... And for good reason, it's too tricky.

The use of the window global to access IDs in the DOM ought just be 
considered a tool for easy and quick debugging. Any properly written app 
should use standard DOM methods in deployment.

-Charles

On 12/8/11 1:02 AM, Vicky Tux wrote:
>
> Thanks for your response. But it was not a typical web stuff, it is 
> compatibility issue. Some web applications written to access the 
> elements without getElementById.
>
> Is there any way to implement this stuff on Webkit..? Please give 
> hints regarding this.
>
> -Vicky
>
> On Wed, Dec 7, 2011 at 9:36 PM, Ariya Hidayat <ariya.hidayat at gmail.com 
> <mailto:ariya.hidayat at gmail.com>> wrote:
>
>     > I have facing an issue with Direct DOM  access via "document"
>     object.
>
>     Because it is not part of the DOM standard.
>
>     This is elementary web stuff, it would be helpful if you would have
>     done some basic research first as this mailing list is not to teach
>     people about browser scripting and incompatibilities.
>
>
>
>     --
>     Ariya Hidayat, http://ariya.ofilabs.com
>
>
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20111208/15e09fac/attachment.html>


More information about the webkit-dev mailing list