In order to do some of the blog styling and the planned interactive stuff, a DHTML/AJAX library was really required. I've used many (custom, Prototype, Scriptaculous, MooTools, Ext2, YUI, etc.) but the current personal favorite is jQuery. It is clean, concise, and well supported (with many plugins, which will be explored in a later post). There's not much to say about hooking up jQuery except that it is being served by Google's AJAX Libraries API instead of the usual static.transisted.com. The inclusion was done using a <script> tag inside the <head> tag:
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js' type='text/javascript'/>
Now that jQuery was in place, the call to the Google Code Prettify source code formatter could be redone. The prettyPrint() call was moved into the jQuery window onload event handler with the following bit of JavaScript inside the <head> tag:
<script language='JavaScript' type='text/javascript'>
$().ready(function () {
prettyPrint();
});
</script>
Not exactly sexy but it does pave the way for doing lots of interesting things.
0 comments:
Post a Comment