--UPDATE-- Turns out my browser is caching my scripts. I can't believe I couldn't find this out from 15 mins of Googling..
I've hit upon something I think is really weird. Turns out, it doesn't even matter what I write into the script! I'm using CodeIgniter
This is in my view:
<script src="<?php echo base_url('/assets/js/ajax.js');?>"></script>
<span id="dislike_error" style="color:red;"></span>
ajax.js
is currently empty but this is the code before:
$('#btn_dislike').click(function (){
$.post("interact/"+challenge_id, {'action':'dislike'}, function(data){
if (data == true){
var old_likes_number=parseInt($('#dislike_number').text());
var new_likes = old_likes_number+1;
$('#dislike_number').text(""+new_likes);
}
else{
$('#dislike_error').text('WTFF');
//$('#dislike_error').html("You have already disliked this challenge.").
}
}).fail(function(){alert('Fail');});
});
Why is this? I tried closing the tab in the browser. I tried restarting the browser. But somehow the browser remembers the Javascript that was there before?!