Tuesday, 20 August 2013

update records ajax jquery isn't working

update records ajax jquery isn't working

I'm writing a script that can update a status in the database.
My php code is:
<?php
include ('../model/incentives.class.php');
$change = new Incentives;
$change_status = $change->change_status($_GET['id'], $_GET['status']);
?>
this works, (i tested it without ajax)
my ajax is:
function change_status(id, status) {
$.ajax({
type: 'GET',
url:('control/change_status.control.php'),
data: 'id='+id+'&status='+status,
cache: false,
})
window.location.reload(true);
}
and i call the function with
<a href="javascript:change_function(1, 0);">Change Status</a>
But this won't work. is there anybody who knows how to fix this ?
thx!

No comments:

Post a Comment