Ahhh.. Now, <TABLE ID="MyTable"> ...here go the links...</TABLE>
<SCRIPT>document.getElementById('MyTable').innerHTML =
MakeMyMenuReplaceTheOldTable();</SCRIPT>
will work??
Have to try that. Very cool!
I can't say I like that approach. I imagine that it will still provide
poor support for some browsers. Richard's suggestion of a list modified by
CSS and scripting is the best. Though many people implement menus along
this line, the only one that I've found to be well implemented to date is
this one:
<URL:
http://www.gazingus.org/html/Using_Lists_for_DHTML_Menus.html>
It is a little different in that you must click on the items to open the
menu (just like an application menu bar), but at least this means that the
menu won't disappear whilst you're trying to make a selection.
Be aware that this style of menu will mean you must provide valid pages
for the first level of links, as well as for the sub-menus. However, this
will have been a consideration with any well implemented menu.
BTW. JavaScript looks more and more attractive to me. Is there any
Intelli-sense IDE for it?
Unfortunately, it's not practical (though some vendors have implemented
them anyway). There isn't really any guaranteed set of properties and
methods that are supported by all browsers, especially with regard to
newer technologies. You could list every single known member for an
object, but that wouldn't be very helpful to the developer.
Or at least an reference where I can read about all methods and
properties available for all object types?
The group's FAQ contains some:
<URL:
http://jibbering.com/faq/>
A shorter list would contain (watch for wrap)
Netscape's JavaScript references:
<URL:
http://devedge.netscape.com/central/javascript/>
Note that the more recent version strip out the older host objects
(document, window, location, history, etc). I presume that this is because
they wish to focus around the World Wide Web Consortium (W3C) Document
Object Model (DOM). However, the host objects are still implemented in
browsers, and are described in v1.3 of the references.
Microsoft's DHTML reference:
<URL:
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp>
A lot of the features described are implemented only by IE, so you should
be careful what you use. The documentation is also incorrect in places.
W3C DOM technical reports:
<URL:
http://www.w3.org/DOM/DOMTR>
The Level 1 specifications are fairly well supported by recent browsers,
and the more compliant browsers (Mozilla and Opera) do well with Level 2.
Level 3 has only recently reached Recommendation status, so support will
be poor.
ECMAScript specification:
<URL:
http://www.ecma-international.org/publications/standards/Ecma-262.htm>
This particular piece of documentation can be very difficult to
understand, but it does specify exactly what JavaScript should support, as
well as it's syntax and features. The Netscape references give a much more
understandable, though simplified, description of most of the contents.
I'd recommend that you also read the group FAQ (link already given above),
particularly item 4.26 - How do I detect Opera/Netscape/IE? That article
contains links on how to perform feature detection - vital when using
objects that aren't always supported.
Good luck,
Mike