Have you ever needed to remove a JS or CSS file in certain conditions such as a custom themed page? In Drupal 6 that has become a whole lot easier.
On a recent project there was a need to strip a couple page views down to a extremely basic output that was to be used in an iframe. For various reasons I didn't want any extraneous module included JS or CSS files included and while Drupal is good at only loading what is needed there are a few exceptions. For example one module that is almost always found on a Drupal site is the Administration menu module which makes all administrators lives a little easier. While a boon most of the time in this case I needed to get rid of those helpful little menus as it obstructed the output that would be displayed in that tiny iframe for anyone having permissions to see the Admin Menus.
jQuery Update removes the core jQuery JS from the $variables['scripts'] array and adds in it's own updated js file. This is a very elegant solution to overriding core or module specific js files if you have a need to. In my case I wanted to simply drop the admin_menu.js file from the $variables['scripts'] array as well as remove the associated CSS files for admin_menu and a couple of other css files plus add in my own to style that stripped down page.
To do this I needed to use the new in D6 hook_theme_registry_alter function as well as an accompanying preprocess_page function.
Here's my code (wrapped in spots):