jquery document ready function not being called

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

my javascript

Read More
jquery(document).ready(function($) {
    alert("hello world");
    $("#testdiv").text("hi");
});

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>
<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)

Related posts

Leave a Reply

2 comments

  1. You could try writing it a little differently. Instead of

    jquery(document).ready(function($) {
        alert("hello world");
        $("#testdiv").text("hi");
    });
    

    Try this:

    (function($) {
        $(document).ready(function(){
            alert('hello world');
            $('#testdiv').text('hi');
        });
    })(jQuery);