473,396 Members | 1,966 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,396 software developers and data experts.

Not working in Modzilla

Please tell me why this will not work in Modzilla yet works in IE? None of
the <div> show. They are to be layered one on the other and then one show at
a time. Nothing shows and I don't know why.

http://wyght.com/warren/not_working.html

thanks

--

Totus possum, totum Deum.
Totus ero, totum meum.
WSW
Apr 18 '06 #1
8 1266

News wrote:
Please tell me why this will not work in Modzilla yet works in IE? None of
the <div> show. They are to be layered one on the other and then one show at
a time. Nothing shows and I don't know why.

http://wyght.com/warren/not_working.html

thanks

--

Totus possum, totum Deum.
Totus ero, totum meum.
WSW


So that really works in IE?

You're using "getElementById", yet their's no element with that ID.

The "name" attribute is not the same as "ID"

Apr 18 '06 #2
"[on]" <sw********@gmail.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...

News wrote:
Please tell me why this will not work in Modzilla yet works in IE? None
of
the <div> show. They are to be layered one on the other and then one show
at
a time. Nothing shows and I don't know why.

http://wyght.com/warren/not_working.html

thanks

--

Totus possum, totum Deum.
Totus ero, totum meum.
WSW


So that really works in IE?

You're using "getElementById", yet their's no element with that ID.

The "name" attribute is not the same as "ID"


Yup it works on IE, but then that does not mean much

question;

if I dynamically create a couple of <form> elements and in each I
dynamically create a number of <div> elements using JavaScript, will I be
able to capture them using "getElementsByName"?

It does not seem to be working
Apr 18 '06 #3
[on] wrote:
News wrote:
Please tell me why this will not work in Modzilla yet works in IE? None of
the <div> show. They are to be layered one on the other and then one show at
a time. Nothing shows and I don't know why.

http://wyght.com/warren/not_working.html

thanks

--

Totus possum, totum Deum.
Totus ero, totum meum.
WSW

So that really works in IE?

You're using "getElementById", yet their's no element with that ID.

The "name" attribute is not the same as "ID"


IE uses "name" as "ID" if there is no ID present, for some stupid reason.
Apr 18 '06 #4
News wrote:

You're using "getElementById", yet their's no element with that ID.

The "name" attribute is not the same as "ID"

Yup it works on IE, but then that does not mean much


See what was written above - your answer is there.
question;

if I dynamically create a couple of <form> elements and in each I
dynamically create a number of <div> elements using JavaScript, will I be
able to capture them using "getElementsByName"?


getElementsByName does not return an object, it returns an array of all
objects with that name. "name" can be duplicated, "ID" should be unique.
Apr 18 '06 #5
VK

Tony wrote:
getElementsByName does not return an object, it returns an array of all
objects with that name. "name" can be duplicated, "ID" should be unique.


document.getElementById in IE is just a "spoof wrapper" over the native
document.all
So it does a lot of strange things on IE. Say it returns *all elements
with matching id OR name*. So say if you have a form with
name="shipping" and a div with id="shipping" you'll get a collection of
two elements (both form and div). And atop of it you'll get
automatically created global variable "shipping" pointing to the div. A
mad house...

On the other end Firefox does a strange thing too: it recognize "name"
attribute for any element and adds it to the DOM tree; but this
attribute is visible as object property only for DOM 0 elements (forms,
form elements, links etc.)

Any way: do not use "name" unless these are DOM 0 elements you can
handle with separate DOM 0 methods (document.forms[i].elements[j],
document.images, document.links, document.anchors). For DOM 1 or higher
methods use ID's and make sure they are unique on the given page.

Apr 18 '06 #6
VK wrote:
Tony wrote:
getElementsByName does not return an object, it returns an
array of all objects with that name. "name" can be duplicated,
"ID" should be unique.
document.getElementById in IE is just a "spoof wrapper" over
the native document.all
So it does a lot of strange things on IE. Say it returns
*all elements with matching id OR name*. So say if you have
a form with name="shipping" and a div with id="shipping"
you'll get a collection of two elements (both form and div). ...


The - document.getElementById - method in IE does _not_ever_ return a
collection. It returns either a reference to a single Element node or
null.
On the other end Firefox does a strange thing too: it
recognize "name" attribute for any element and adds it
to the DOM tree; but this attribute is visible as object
property only for DOM 0 elements (forms, form elements,
links etc.)
I suppose that is an inarticulate way of expressing that Mozilla
represents all HTML attributes as attribute nodes in the DOM but does
not create properties of the corresponding Element in the DOM unless
(and with the exception of intrinsic event attributes) the W3C DOM
specification defines the property in the interface definition for the
Element of that type. That is a long way from being strange behaviour.
Any way: do not use "name" unless these are DOM 0 elements
you can handle with separate DOM 0 methods
(document.forms[i].elements[j], document.images,
document.links, document.anchors). For DOM 1 or higher methods
use ID's and make sure they are unique on the given
page.


As all DOM 0 'elements' are formalised in HTML DOM levels 1 and 2 that
advice is impossible to follow. A more reasonable suggestion would be to
only use name attributes on Elements for which the pertinent HTML
version/DTD specifies a name attribute (with additional regard to the
text of the HTML specification).

Richard.
Apr 18 '06 #7
VK

Richard Cornford wrote:
The - document.getElementById - method in IE does _not_ever_ return a
collection. It returns either a reference to a single Element node or
null.


Right, that must be not my week :-(
I was thinking about getElementByName weirdness in IE.

Here is a summary of the most weird things (by my scale) IE does:

<html>
<head>
<title>IE in all its beauty</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function init(){
// 1) IE doesn't distinct names and id's in getElementById
// whatever it sees first - this it returns:
var obj = document.getElementById('shipping');
alert(obj.tagName); // "FORM"

// 2) IE creates parasite global vars for each id'ed element:
try {shipping = 'UPS';}
catch(e) {alert(e.message);} // error

// 3) getElementsByName returns all elements with matching
// name OR id
var elm = document.getElementsByName('shipping');
alert(elm.length); // 2
}

window.onload = init;
</script>
</head>

<body>
<form name="shipping" action="">
<input type="hidden" name="cost" value="10">
</form>

<div id="shipping">&nbsp;</div>

</body>
</html>

Apr 19 '06 #8
VK wrote:
Richard Cornford wrote:
The - document.getElementById - method in IE does _not_ever_
return a collection. It returns either a reference to a single
Element node or null.


Right, that must be not my week :-(
I was thinking about ...

<snip>

I could not care less what you where thinking (if you actually were), it
is the bullshit you posted that I was commenting upon.

Richard.
Apr 19 '06 #9

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

Similar topics

10
by: Ukiharappa | last post by:
Hello All, I am not sure why. It works on Outlook and other mail clients. I have put it as an include file to the .css instead of putting it inline with the html email. Anyody has any ideas...
2
by: Better but still clumpsy | last post by:
This function works as intended with Netscape/Modzilla. But, it doesn't work with IE version 6.0.2900.2180.xpsp_sp2_rtm040803-2158. Can someone tell me how to fix it? Thanks. function...
2
by: Gary | last post by:
I am trying to use the "System.Windows.Forms.SendKeys" class for triggering the Ctrl+P key. Syntax: System.Windows.Forms.SendKeys.Send("^(P)"); This is not working ..what could be the...
6
by: Mullin Yu | last post by:
hi, i have a web service that has file operations on Windows OS, and there may be a file concurrency issue if only one working directory e.g. c:\working therefore, i want to have a unique sub...
5
by: Martin Heuckeroth | last post by:
Hi We are working on a webservice application and are having some problems with the cookies and/or sessions. We have them working on our intranet but then its not working on the internet. We...
5
by: tshad | last post by:
I have been working with setting my drop boxes to allow double clicking to select an item. It worked fine until I made some changes. I then stripped the page down to the bare essentials to find...
8
by: jojobar | last post by:
Okay, I am trying to do is to test the webresource in 2.0 1. I created a new project with assembly name (and default assembly name) "Office". 2. I added the following to the AssemblyInfo.cs...
2
by: Don | last post by:
I'm having problems with intellisense, autocomplete, etc. suddenly not working in certain classes of a project I'm working on. All the options are set, and it all works fine for most classes, but...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.