Reputation: 8582
function decreased(param) {
console.log(param);
$.ajax({
type: "GET",
url: "scripts/closed.php",
data: "name=" + param,
success: console.log('success'),
});
}
I don't know why my function isn't working. The path is correct the param is correct if i type in closed.php?name=param the script there works and in the end after calling the function i get the console log success printed, i really don't understand.
Upvotes: 0
Views: 50
Reputation: 1038720
The problem is with your success
handler. It should be like this:
$.ajax({
type: "GET",
url: "scripts/closed.php",
data: { name: param },
success: function(data) {
console.log('success');
}
});
Also notice the usage of a hash for the data
parameter which allows to properly URL encode values.
Upvotes: 3