473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

reference, on javascript and dom

Hello. I often need to write cross-browser javascript, so far gecko dom
reference is the reference seems mostly suite me, for things running
well on gecko are likely to be running well on other engines. Perhaps
gecko is the closest to w3c recommendations (if not Amaya)?

Now it seems many of javascript/dom is not converted by gecko reference.
So what reference do you use? I want a very complete reference for web
scripting in HTML document authoring, but not so detailed as
recommendation itself.

For example of in-completeness of gecko reference: I once saw someone
coded like this:
var options = new Options();
However Options type of object is not mentioned in gecko reference. Also:
document.getElementById("selector").add(newoption)

Here the add method is not mentioned in gecko reference.
Jul 23 '05 #1
1 1274
On Wed, 27 Oct 2004 23:41:31 +0800, Zhang Weiwu <zh********@realss.com>
wrote:
Perhaps gecko is the closest to w3c recommendations (if not Amaya)?
Opera is very good, too, but it does emulate some of Microsoft's DOM and
script "features".

Amaya isn't particularly good. It has no ECMAScript support, and it's CSS
implementation isn't complete (even IE has better support in some
respects).
Now it seems many of javascript/dom is not converted by gecko reference.
So what reference do you use? I want a very complete reference for web
scripting in HTML document authoring, but not so detailed as
recommendation itself.
I'm afraid I only use the W3C Recommendations. I doubt there is anything
as comprehensive, so it might be an idea to try and learn to understand
it. Certainly do not trust Microsoft's DHTML Reference (if anyone
recommends it in this thread). It doesn't conform to the DOM, sometimes
even when entries state they do.
For example of in-completeness of gecko reference: I once saw someone
coded like this:
var options = new Options();
I would imagine it was:

var option = new Option();

This is a remnant of "DOM 0", specifically Netscape's JavaScript. In newer
browsers, it's directly equivalent to:

var option = document.createElement('OPTION');
However Options type of object is not mentioned in gecko reference.
Though the DevEdge web site is dead, you can read the v1.3 reference using
the "Wayback Machine" (<URL:http://web.archive.org/>):

<URL:http://web.archive.org/web/20040202050531/devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/>
Also:
document.getElementById("selector").add(newoption)
I expect that's the HTMLSelectElement.add method, used to add newly
created OPTION elements to a SELECT element. You should know, however,
that the actual interface is:

add(newOption, referenceOption)

where referenceOption refers to the OPTION that will end up positioned
*after* the new OPTION. Specifying null adds the new OPTION to the end of
the list.

This is an example where IE is non-conformant. IE allows the the second
argument to be optional (it must *always* be specified, even if null), and
it uses a number not an object reference. To be able to use the add method
effectively, you have to use try/catch to catch the exception thrown if
you use the W3C approach in IE, or the IE approach with other browsers.
Because of this, it's probably better to use appendChild or insertBefore,
instead.
Here the add method is not mentioned in gecko reference.


No. Most elements, and their members, aren't.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: N/A | last post by:
Hey all, If I open a popup like this window.open('http://www.google.com', 'popup', 'width = 618, height = 425, directories = no, location = no, menubar = no, resizable = no, scrollbars = yes,...
2
by: Brian Vallelunga | last post by:
I'm working on an asp.net site and am trying to implement a popup help window. I want the window to close when the user advances to the next page in our application. The thing is, I'm doing this on...
3
by: Jack Fox | last post by:
Ideally I could drill down through objects, events, methods, and properties... ....and it would tell me where the IE (not DHTML) and Netscapte DOMs are the same and where they differ, ....and...
8
by: wASP | last post by:
Hi, I'm having a problem referencing the elements within an object after a method of that object (a member function) has been activated with an onsubmit handler: - - - - - - - - ...
6
by: ged | last post by:
Hi, i am a oo (c#) programmer, and have not used javascript for a while and i cant work out how javascript manages its references. Object References work for simple stuff, but once i have an...
2
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is...
3
by: Darrin | last post by:
I've seen a couple threads on this that did not answer my question and I could not add a post to them. I've inherited a web application that is going to be replaced in the coming months. For the...
5
by: aelred | last post by:
I have a web page where a member can open up a chat window (child window) with another member. - From there the member can also navigate to other web pages. - From other pages in the site, they...
19
Frinavale
by: Frinavale | last post by:
I'm in the middle of implementing a custom Ajax enabled Server Control. At this point I need help finding the answer to an Ajax Framework question...here it goes: I have a Server Control that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.