"Montezuma' s Daughter" <Ur*********@gm ail.comwrites:
I wanted to know what is the difference between:
1.getting an object
the first worked for me and the other didn't
var Subform = document.getEle mentById("Items 2");
var Subform =document.all(" Items2")
In which browser?
The former is the W3C DOM standard method for finding an element
by its id. It works in all modern browsers and in IE 5+.
The latter is the Microsoft proprietary method for finding an
element by its id (or name). It works in IE 4, and most new browsers
emulate the document.all collection - at least if you use it as
document.all["Items2"]
instead of as a function.
Use the former, but if document.getEle mentById doesn't exist, you
might want to fallback to document.all (if that exists).
2.I was tryng to do attachedEvent, again the first one worked and the
other didn't, I would like to understand why.
I didn't get any error jus didn't work
var Subform = document.getEle mentById("Items 2");
Subform.onready statechange = function() {setIPandDetach
(event.srcEleme nt,currentRowID )} ;
This probably only worked in IE anyway. The "event" variable
is global in IE, but is passed as argument to the handler function
in most other browsers.
var Subform =document.all(" Items2")
document.all("S ubform").attach Event("onreadys tatechange", function()
{setIPandDetach (event.srcEleme nt,currentRowID )}
Do you mean to do 'document.all(" Subform")'?
Why not just "Subform.attach Event(...)"?
Your code is IE specific and won't work well, if at all, in most other
browsers.
/L
--
Lasse Reichstein Nielsen
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'