This is as days pass by, by Stuart Langridge

And this is generated-toc: Generate a Table of Contents with the DOM, written , and concerning JavaScript and the DOM

More excitement from the Stuart House Of JavaScript Stuff: generated-toc: Generate a Table of Contents with the DOM. A very easy way to get a table of contents onto your documents: generate a table of contents using JavaScript. A big thanks goes out to the organisation who funded this work, who I can't name. Getting stuff like this out into the world is a good thing, and them allowing me to open-source it is better still. Good work.

Comments

bruce

BTW - a bug in IE6 (who'd've thought it?) means that the empty div that's a placeholder for the generated TOC produces throws a blank line.

You can get over this by having a blank comment inside the blank div:

<div id="generated-toc"><!-- --></div>

This website belongs to Stuart Langridge. Contact details are available. Don't eat yellow snow. Valid HTML5, at least in theory, except for the bits that aren't because I'm that futuristic that I'm ahead of the spec, oh yes. HTML5 help from Bruce Lawson, among others. Fonts from the superb FontSquirrel. End.