Closed Bug 111041 Opened 23 years ago Closed 23 years ago

Elements do not have open, writeln, close methods

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows NT
defect
Not set
normal

Tracking

()

VERIFIED WONTFIX

People

(Reporter: wayfarer3134, Assigned: jst)

Details

In both Netscape 4.x and IE 4.x+, nodes could have new content generated by doing
the following:

<DIV ID="MYNODE" ></DIV>

<SCRIPT>
  var mynode;
  if( navigator.appName == "Netscape" ) {
     mynode = document.MYNODE.document;
  }
  else {
     mynode = document.all.MYNODE;
  }
  mynode.open();
  mynode.writeln("<B>THis is a new bold sub-element</B>");
  mynode.close();

As well, IE 4+ this could be done instead as:
  mynode.INNERHTML = "<B>This is a new bold sub-element</B>");

However, there doesn't appear to be this functionality any longer in Mozilla.
It is possible to use the DOM level 1 methods to achieve the same functionality,
but at the cost of writing an HTML parser that generates DOM-1 updates.  

It isn't too difficult to use:
  mynode = document.getElementById("MYNODE");
but not being able to set the new content of a node is extremely annoying for
things like menus etc.  

Note that if mynode were a frame as part of a frame-set, this would all work
since one can use:
  document.MYFRAME.open();
  document.MYFRAME.writeln("Some new frame info");
  document.MYFRAME.close();
However, not everything is handled as frames.
Element.innerHTML does work in Mozilla (element.INNERHTML does not, nor does
that work in IE AFAIK). document.foo.document is a NS4.x:ism that's not
supported in mozilla or IE, and I don't see IE supporting
element.open/write/close either.

Marking WONTFIX.
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → WONTFIX
Marking verified
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.