im currently working with jQuery ajax and i get some unexpected error.
I use firebug to debug javascript.
In my console the GET request link is red.
My jQuery isn’t realy hard…
$.ajax({
method: "post",
url: '/scores/update/' + $(this).val(), <-- could be '/scores/update/1'
success: function( msg ) {
$('.feedback').html( msg ).fadeIn();
}
});
The map scores/update dont realy exists. I use htacces make the link into. index.php?uri=scores/update/1. After this $_GET[‘uri’] is going in my router.php and this will be direct to the following method
class scores()
{
public function update($int)
{
echo $int;
}
}
What am i doing wrong?
The echo wont be send, the link in my firebug console is red. Is this a cross-domain error? Is it my htaccess? It is driving me crazy.
Thanks in advance!
I got the fix, In any case thanks guys.
The fix:
I had
<input type="submit" name="score" value="1" class="score button1" />and jquery want me to have
<input type="button" name="score" value="1" class="score button1" />