user1683645
user1683645

Reputation: 1579

ReferenceError: $ is not defined strange

How come everything in homecooked.js works but the script that is below it does not and the browser gives me "ReferenceError: $ is not defined" on that specific part?

    <script src="assets/jquery-1.8.2.min.js" type="text/javascript"></script>
<script src="assets/homecooked.js" type="text/javascript"></script>
<script type="text/javascript">
        $(document).ready(function(){
        <?php if($profile_messages){?>
            $('.page').hide().eq('2').show();
        <?php } else { ?>
            $('.page:gt(0)').hide();
        <?php } 

        for($i = 0; $i < ($image_array_length); $i++){ ?>
                $(".modal-textarea").limit("120",".comment-counter");
            <?php }?>
        });
</script>

Upvotes: 0

Views: 95

Answers (1)

Jai
Jai

Reputation: 74738

try changing with this one:

jQuery(document).ready(function($){

we can use the dollar sign in place of jQuery as much as we like this way.

you can take a look at the documentations here: http://docs.jquery.com/Plugins/Authoring

Upvotes: 1

Related Questions