Sorry about the cryptic suject. The following works perfectly in IE 5.0
on Win98. However, I'm having the strangest problem with it on Mozilla
M18 on Linux.
To demonstrate:
http://www.cogsci.ed.ac.uk/~ddb/teaching/hume/enquiry/test.html
(The above works only in IE5, NN6)
Basically the above doc is a frameset. The lower frame ("Content")
contains text in an expandable/collapsable "tree". Each node has a
graphic which can be clicked to expand and collapse that branch.
The top frame ("Menu") has a menu, and the View menu contains commands
to Expand or Collapse the entire tree at once. These are defined as
follows:
function expandAnalysis() {
for ( var i = 0; i < parent.Content.document.images.length; i++) {
if (parent.Content.document.images[i].src.indexOf("rightarrow.jpeg")
!= -1) {
parent.Content.document.images[i].onclick({type: "click"});
}
}
}
function collapseAnalysis() {
for (var i = 0; i < parent.Content.document.images.length; i++) {
if (parent.Content.document.images[i].src.indexOf("downarrow.jpeg")
!= -1) {
parent.Content.document.images[i].onclick({type: "click"});
}
}
}
(These may not be the most elegant way of doing things, cycling through
each node and simulating clicking on it, but it was the easiest.)
Now the problem in M18 is that if the Content page is loaded collapsed,
then expandAnalysis() generates this error:
parent.Content.document.images[i].onclick is not a function
even though collapseAnalysis() generates no error. If I re-edit the
Content page so its default state is expanded, then collapseAnalysis()
generates the above error and expandAnalysis() generates none. However,
if you go to the above URL, manually expand the entire tree by clicking
on each node, then both expandAnalysis() and collapseAnalysis() work as
expected without generating any errors.
What is the explanation of the above behaviour? Any and all help very
gratefully received.
Thank in advance,
Darren
--
======================================================================
D. D. Brierton Department of Philosophy, University of Edinburgh
[EMAIL PROTECTED] http://www.cogsci.ed.ac.uk/~ddb
======================================================================