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.

asked Jul 23, 2014 at 13:41

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.

answered Jul 23, 2014 at 13:43
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.

answered Jul 23, 2014 at 13:43

Comments

1

Try This

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

JSFiddle

answered Jul 23, 2014 at 13:47

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

answered Jul 23, 2014 at 13:47

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.