Photo credit: Windell H. Oskay,
on creative engineering and new media art

Lorem Ipsum Generator: grab the javascript

June 10th, 2009

If you are reading the full entry, there is a  paragraph of fake latin above. It was generated using my Lorem Ipsum Generator. You are welcome to grab and use the javascript here: loremipsum.js.

If you peek at the code of this post, the updatePage stuff is just for WordPress, you don’t need that. To include the loremipsum.js on your own webpage, just copy the loremipsum.js to your server, link it in with <script src=”loremipsum.js”></script>, and then do<script>loremIpsumParagraph(100);</script>on the page. The number is the number of words you want in the paragraph. See the comments in the file for more details. It is designed to be simple to add more dictionaries to use your own languages. It has no grammar as such, it is just a random jumble of words.

Update: Note that you do need to close the script element separately, even if you only include a script. You have to do <script src=”whatever”></script>, trying to compress it to <script src=”whatever” /> will not work (on most browsers, at least). If you want to be well-behaved you should also include what sort of script you are running: <script type=”text/javascript” src=”loremipsum.js”></script> — any year now major browser will be supporting other languages.

Since you read this far, you might as well see a Swedish paragraph too. The Latin words are from Ovid’s Metamorphoses, the (rather arcane) Swedish is from August Strindberg’s Röda Rummet.

This is another of those “scratch your own itch” things. I am not sure anybody else needs this, but I find it useful myself – it’s nice to have a tool like this to fill your templates with text when you are doing web development. Oh, and if you’re seeing the RSS feed this may or may not work as intended. Probably not.