I am essentially making it so when you click on a button to \"vote up\"
at the moment i have
clients.php
Why do I get an error in the console saying "ReferenceError: voteUp is not defined"
Scope.
The voteUp()
and voteDown
are defined in the startup block (within the {}
of $(document).ready(function() ...
so are not available outside this block.
You need to move the two functions outside:
$(document).ready(function() {
...
});
function voteUp()
{
$.get("voteup.php");
return false;
}
function voteDown()
{
$.get("votedown.php");
return false;
}