473,657 Members | 2,579 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.getEle mentById("selec tor").add(newop tion)

Here the add method is not mentioned in gecko reference.
Jul 23 '05 #1
1 1284
On Wed, 27 Oct 2004 23:41:31 +0800, Zhang Weiwu <zh********@rea lss.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.create Element('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.netscap e.com/library/manuals/2000/javascript/1.3/reference/>
Also:
document.getEle mentById("selec tor").add(newop tion)
I expect that's the HTMLSelectEleme nt.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
16886
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, status = no, toolbar = no'); Then I know that there is a window object in the windows collection called 'popup'. So how can I make that window come to the front? Looking for
2
7725
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 a component basis and I don't have access to the body tag from within my help component, so I can't add the onunload tag. Is there some other way of achieving what I want? Can I add an eventhandler to the body tag through javascript? Thanks, ...
3
2057
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 it would actually document objects, events, methods, and properties, rather than just listing their names. Does such a thing exist?
8
1864
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: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <script language="javascript" type="text/javascript"> function js_onsubmit_hndl_fn () {
6
5578
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 object collection and stanrd using it it starts to fall apart. Clearly there is something about javascript's usage of passing "By ref" that i am not getting. i have had a look on the web and found some examples, but i cant see why my code does not...
2
3048
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 what I'm hoping to achieve. I've never before had to use Javascript closures, but now I do, so I'm making an effort to understand them. I've been giving this essay a re-read: http://jibbering.com/faq/faq_notes/closures.html
3
16653
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 time being, I would like to add the Analytics (Urchin) script to the page, but there is no common components for the 100's of pages in the site. There is however a common javascript file that is referenced from all of the pages. I would like...
5
10282
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 may also open up new chat windows with other members (just not the same one). - Each chat page is opened with the member name as the window name. - When I log off from the web page, I would like all the chat windows to automatically close. I...
19
4550
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 extends from a Panel and implements the IScriptControl interface: Public Class MyCustomControl Inherits Panel Implements IScriptControl This Server Control consists of a collection of Labels, Panels, Buttons, Literals, other Ajax...
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8730
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8605
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1950
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1607
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.