Automate the Pagination of Your Web Pages
- Creating Pages from Linear HTML Text
- Getting Started
- Solution Overview
- Test Drive
Creating Pages from Linear HTML Text
Jason Cranford Teague’s article "Creating Web Pages for Screen, Print, and Email" presents a wonderful idea: Split the contents of a single web page into multiple screen-sized pages that visitors can jump between without reloading the content from the server. However, the source HTML file has to be split into well-defined pages; the solution presented in the article used DIV tags.
Unfortunately, most of us aren’t lucky enough to be able to enforce such content-structuring rules. Quite often, we’re faced with hundreds of existing web pages that have to be refurbished into a new design or presentation paradigm, and changing all the source content is usually out of question. By using the Document Object Model (DOM) on the client side, however, you can usually restructure the content after it has already been downloaded to the browser. In this article, I’ll show you how to use JavaScript in your browser to transform linearly structured HTML text into pages marked with DIV tags. The result can then be used to create onscreen pagination.