jQuery Error: $ is not a function

This is a fun little jQuery error you’ll hit sometimes when you are trying to integrate jQuery into an already established system like Wordpress or Drupal, that is already using a Javascript library like prototype.  The problem is that you are hitting conflicts between the two libraries.  And most likely they are fighting over the $ .

Luckily, jQuery is prepared to handle this!  Good’ol jQuery.

jQuery has a “noConflict” mode, that will let all the jQuery content to run without using the $.  You just state that you are running in noConflict mode in your first line, then instead of using $(function(){…}, you replace the $ with jQuery, so it looks like this: jQuery(function(){….

Here’s a full example.

<script>

jQuery.noConflict(); // Tell jQuery you are going with noConflict mode.

jQuery(function(){ // Replace the $ with jQuery
jQuery(’div’).doStuff();
});

</script>

This will allow the other library to use the $ without conflict.

Posted: January 20, 2010  | Under: jQuery | Leave a Comment

The Wordpress White Screen of Death!

So there you are, happily updating your blog theme and BAM!

The Wordpress whitescreen of death!

The Wordpress white screen indicates that there is a problem with your current theme.  Unfortunately at this point, you can’t go change the theme to unbreak it, since the theme selector is just going to spit out PHP errors.  See the problem is, the database still has entries pointed to the “current” theme, which is either bugged, incomplete or gone.

Here are the symptoms:

What to look for:

Check to make sure your theme files are still in place.  Deleting the current themes directory, renaming the theme directory or moving the current themes directory to a new location will all cause this error.

If files were moved or deleted, the best thing to do is to just put things back where they were, switch to another theme, then do your changes or removal of the old theme.

If that’s not possible, you can go manually change the current active theme in the database.  The current template data is stored in the ‘options’ table, option_name “template”.  Just change it to the folder name of another theme.  It’s not pretty, but it works and will get you back up and running.

Posted: January 5, 2010  | Under: Wordpress | Leave a Comment

Official Wedding Announcement

Well it’s official, I be getting married!  Wohoo!

Here’s the “official” announcement. Read more

Posted: June 1, 2009  | Under: Personal | 1 Comment

Loooooooong Break

Wow, I have not posted in quite a while. I’ve been spending a LOT of time working on my own personal side projects. Building sites and working on promoting them. Fun stuff!

Now that I have a little group of growing sites, it’s been interesting to see the results.

Read more

Posted: April 2, 2009  | Under: Personal | Leave a Comment

Strange Blizzard Splash Screen Image

So Blizzard Entertainment has some new “super amazing something”(tm) that they are going to announce.  So in true Blizzard style they are keeping everyone in suspense, with a splash screen that has been slowly showing “something” locked behind a sheet of ice.

Today you can see a pair of glowing eyes. Read more

Posted: June 27, 2008  | Under: Random | 1 Comment

Next Page →