A few days ago I released a small open source jQuery plugin called footnote.js.  The idea for this plugin came to me as I was writing an article on postal.js (coming soon!).  I was adding some footnotes, and as I re-arranged text in my html document, I had to re-arrange the footnotes to match the order of the superscript tags in the document.  As you can imagine, this is a colossal pain in the ass, so in a fit of inspiration, I hacked together a jQuery plugin to manage this for me.  In short, when the document loads, it reads the order of superscript tags in the DOM, then reorders the items in an ordered list (the footnotes) to match.  It also re-numbers all of the superscript tags and creates hyperlinks to the corresponding footnotes.  It does make some assumptions (e.g., that you only have one list of footnotes), but I was striving for the simplest use case, so it is what it is.  Forks and pull requests are welcome, if you feel inclined.

3 thoughts on “footnote.js

  1. Hi Nicolas

    If I have multipages where I need hte footnote numbering to continue from page to page. How do I stop the next page from re-starting the cite numbering at 1?

    Thanks for any advise on this.

    A very useful, time saving plugin.

  2. Hi Laurence, thanks for contacting me! I just added the `offset` option to the `footnote` function which will let you start numbering footnotes at an arbitrary, positive integer. Since you have a multi-page app, you will need to pass the offset number to each page, likely in a query string parameter (kind of like a paging scheme). See the `demo.html` file in the repo which shows exactly how to do this. Good luck, and glad you have found the plugin to be useful.

Leave a Reply

Your email address will not be published. Required fields are marked *