I have a jQuery script that works fine within a WordPress post as long as I include a reference to the jQuery libarary within the post.
<script src="http://code.jquery.com/jquery-latest.js"></script>
From what I have read this is not the proper way to reference jQuery as it is already included within WordPress (using v3.4.2).
If I remove the inline reference the script fails and the console says that “$” is undefined. I also tried replacing “$” with “jQuery” according to articles that talk about NoConflict mode in jQuery.
My jQuery script can be viewed here in jsFiddle.
In order to use $ inside your script (You only need to change the wrapper of your script), use the following wrapper.
Make sure you enqueue jQuery in one of your plugins or theme using
wp_enqueue_script('jquery');
Read more on Codex
The following article contains useful tips on using jQuery with WordPress.