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
user2766423
1671 gold badge2 silver badges9 bronze badges
4 Answers 4
Sure, you're loading jQuery correctly, but you're loading jQuery 1.6.4.
answered Jul 23, 2014 at 13:43
esqew
45k28 gold badges139 silver badges180 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
.on() and .off() weren't introduced until jQuery 1.7. You are loading 1.6.4.
answered Jul 23, 2014 at 13:43
Rodney G
4,8461 gold badge19 silver badges15 bronze badges
Comments
Try This
$(document).ready(function(){
$('#display-feedback-form').click(function(){
$('#feedback_form').show();
});
});
Comments
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();
});
});
answered Jul 23, 2014 at 13:47
alexP
3,7657 gold badges29 silver badges37 bronze badges
Comments
lang-js