Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> However, JS is "a bit" more powerful and has grown out of `document.write()`

Wasn't innerHTML still settable back then?




InnerHTML arrived as a proprietary IE 4 feature and IE 4 launched in 1997, so yes. In Googling to double-check, I came across this little incompatibility: https://gist.github.com/jakearchibald/4489851


On the Netscape side of things innerHTML didn't arrive until NS Navigator 6.0. For Netscape's dynamic HTML model with NS 4.x, it was still a matter of opening a document stream and writing to it (`document.open()` … `document.write()` … `document.close()`), in this case the document of a layer or ilayer element (`document.layers[<layerName>].document`).

There was an interesting bug with `document.write()` in early versions of Netscape Navigator: If you wrote to table cell (td) or row (tr) code containing any embedding elements (like images or form elements) and there was adjacent whitespace around the script tags, the embedding elements (images) would show up twice. This was one of the more obscure bugs in the browser, which likely prohibited a broader use of `document.write()` with dynamic layouts etc at the time. However, if you knew the quirks, you could load data objects in an invisible frame and render/update regions (frames or later layers) much like today.

What was initially setable: Beginning with NS 2.0 (JavaScript1.0) the state of form elements and window locations. Later (NS 3.0, 1996) also href and src attributes of images and anchors (links), the document title, and you could navigate the history, or call print() and find(), as well as manipulate a few other things, like keyboard focus. Of course there were event handlers, but they were quite specific for a few elements. (E.g., onclick or onmouseover were available for links and images only.) More complex interaction (including playing sound!) was possible via a proprietary Netscape Java/JS-bridge, called "LiveConnect".




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: