For some reason I can't get the jquery document ready to fire for my plugin

my javascript

jquery(document).ready(function($) {
    alert("hello world");

the source from my website

<link rel='stylesheet' id='admin-bar-css'  href='http://example.com/wp-includes/css/admin-bar.css?ver=20111209' type='text/css' media='all' />
<script type='text/javascript' src='http://example.com/wp-includes/js/jquery/jquery.js?ver=1.7.1'></script>
<script type='text/javascript'>
/* <![CDATA[ */
var fantasy_golf = {"ajaxurl":"http:\/\/example.com\/wp-admin\/admin-ajax.php"};
/* ]]> */
<script type='text/javascript' src='http://example.com/wp-content/plugins/fantasy-golf/js/fantasy-golf.js?ver=1.2'></script>
<script type='text/javascript' src='http://example.com/wp-includes/js/comment-reply.js?ver=20090102'></script>

when I follow the source of my fantasy-golf.js (in firefox's source) it has the correct version of my js. (it shouldn't be due to it caching an older version)

closed as off topic by Chip Bennett, Wyck, fuxia Apr 25 '12 at 5:33

Questions on WordPress Development Stack Exchange are expected to relate to WordPress within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Close-voted as off-topic. I'm not seeing how this is a WordPress question? You're using no-conflict mode (correctly), and your scripts are either hard-coded in your template, or else properly enqueued. That pretty much eliminates anything WordPress-specific. – Chip Bennett Apr 24 '12 at 20:06
  • I'll move it to stack overflow then... I'm surprised since the plugin from this site does work. itsananderson.com/2011/04/wordcamp-seattle-meta which is pretty much what I'm trying to accomplish. – Joe_Schmoe Apr 24 '12 at 20:09
  • Don't re-post anything. If needed, we can migrate content from one site to another. For now, I'll leave this here. – EAMann Apr 24 '12 at 20:32

Try using jQuery instead of jquery. (Note the capital "Q".)


Upon viewing your source, you have an extra });.

Working example

  • I tried and tried again still no luck. – Joe_Schmoe Apr 24 '12 at 19:51
  • Do you have a link where we can view a sample page? – Joseph Leedy Apr 24 '12 at 19:54

You could try writing it a little differently. Instead of

jquery(document).ready(function($) {
    alert("hello world");

Try this:

(function($) {
        alert('hello world');

Not the answer you're looking for? Browse other questions tagged or ask your own question.