-1

Possible Duplicate:
$ not defined in JavaScript

Firebug is telling me:

ReferenceError: $ is not defined [Break On This Error]

> $.ajax({

but I'm not sure why, or how would I correct this?

This is supposed to write the data from the facebook auth to a url or something so that I can retrieve it later with java.

 <script>
      function login() {
            FB.login(function(response) {
                if (response.authResponse) {
                    // connected
                    console.log((response));
                    console.log((response.session));
                    $.ajax({
                        url: "fbReceiver.html", 
                        data: response,
                        type: "POST",
                        success: function() {}
                    });
                
                } else {
                    // cancelled
                }
            });
        }
 </script>
3
  • 2
    You sure jQuery is properly loaded? Commented Nov 17, 2012 at 22:32
  • is the jquery.js build in? load this ajax at $(document).ready(function() {...}); maybe? Commented Nov 17, 2012 at 22:33
  • Javascript != jQuery. You forgot to include the jQuery library. Commented Nov 17, 2012 at 22:37

1 Answer 1

2

Make sure the jQuery file is loaded above the code you have here.

<script src="jQuery file here"></script>

<script> your code here <script>

You can get the URL of the jQuery file here: http://jquery.com/

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you :), first timer with jQuery here and I was sure missing that

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.