I have my own templates with this code in head:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js"></script>
<script type="text/javascript" src="{{MEDIA_URL}}emotions.js"></script>
But in Chrome code spectrator i always have:
Error in event handler for 'undefined': TypeError: Cannot call method 'replace' of undefined
emotions.js:
$(function(){
$('.emotion').click(function(){
var id = $(this).parent().attr('id')
$.post("something/vote/", { emotion: "emotion", id: "id" } )
$('.vote_value').text('You give your vote')});
});
Any sugegestions of what could be wrong?
I almost guarantee that if you log
$('.vote_value'), you’ll get undefined. Make sure you have an element with that class present in the dom.