[whatwg] Scripting Tweaks

Ian Hickson ian at hixie.ch
Wed Apr 20 07:13:31 PDT 2005


On Wed, 20 Apr 2005, Dean Edwards wrote:
> 
> 1) Mozilla's DOMContentLoaded event is very handy. It fires when a 
> node's content has been loaded and parsed (the DOM has been 
> constructed). This is much better than the standard onload event as it 
> doesn't wait for binary content to also load.

Good idea.


> 2) I'd like to be able to lock/disable an entire document. This is 
> useful when submitting to hidden frames. It helps prevent users from 
> re-submitting data before it has been processed. Ideally, I could 
> disable an entire frameset. Better yet, I can display some kind of 
> visual feedback so that the user knows the page is locked (e.g. 
> hourglass, greyed out content).

Not sure I follow here. I frequently post a form then keep browsing the 
page while the next one loads, opening links in the background. I don't 
want pages stopping that. :-)

You can disable the submit button (indeed maybe UAs should just do that 
by default), would that do it?


> 3) I find myself using Microsoft's uniqueID property quite often. 
> Although the ID attribute is supposed to provide a unique identifier, it 
> often doesn't. We would probably need a complementary DOM method to 
> retrieve an element by uniqueID (IE uses the "all" property).
> 
> http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/uniqueid.asp

Interesting. What's the use case?


> 4) Most DOM scripting revolves around elements. Consequently, I write 
> lots of loops like this:
> 
> for (var i = 0; i < childNodes.length; i++) {
>   if (childNodes[i].nodeType == Node.NODE_ELEMENT) {
>     // do something with the element
>   }
> }
> 
> It would be handy to have the following DOM properties:
> 
> childElements
> firstChildElement
> lastChildElement
> previousElement
> nextElement
> parentElement
> 
> handy but definitely not required.

Way ahead of you:

   http://whatwg.org/specs/web-apps/current-work/#navigating

But in general I think NodeIterator would be better.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list