Skip to content

ReferenceError(s) for “define” in jquery.js and for $ #547

Closed
@syivanes

Description

@syivanes

just started the jQuery tutorial and stuck on the ready event part. Opening the html and file and clicking the "jQuery" link, no alert pop-up comes up like it's supposed to, it goes straight to the jQuery home page instead.

<!doctype html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Demo</title>
</head>

<body>
    <a href="http://jquery.com/">jQuery</a>
    <script src="jquery.js"></script>
    <script>
    </script>
    <script>
        $( document ).ready(function() {
            $( "a" ).click(function( event ) {
                alert( "Thanks for checking" );
            });
        });


    </script>
</body>
</html>

After checking with Firebug, the two errors are ReferenceError: define is not defined for the jquery.js file and the ReferenceError: $ is not defined for the html file. Inserting javascript/jquery instead of jquery.js into the <script src = ... has helped to get rid of the first ReferenceError, $ is not defined still comes up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions