1

Simple problem that I cannot find the answer to. I have made a jsfiddle of the problem.

I have this Javascript code:

$(document).ready(function(){
    $('#display-feedback-form').off('click').on('click', function(){
        $('#feedback_form').show();
    });
});

Here is the fiddle with an example: JSFiddle

Why am I getting this error? Jquery is loaded correctly on the page.

4 Answers 4

7

Sure, you're loading jQuery correctly, but you're loading jQuery 1.6.4.

$.off() and $.on() weren't added until jQuery 1.7.

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

Comments

3

.on() and .off() weren't introduced until jQuery 1.7. You are loading 1.6.4.

Comments

1

Try This

$(document).ready(function(){
    $('#display-feedback-form').click(function(){
        $('#feedback_form').show();
    });
});

JSFiddle

Comments

1

You can use .die() and .live() in jQuery 1.6.4. Until 1.7 there is no .off() and .on() function.

$(document).ready(function(){
    $('#display-feedback-form').die('click').live('click', function(){
        $('#feedback_form').show();
    });
});

DEMO

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.