I'm trying the tutorial from infotuts here: http://www.infotuts.com/ajax-table-add-edit-delete-rows-dynamically-jquery-php/
And there's a javascript like this:
$(function(){
$.ajax({
url:"DbManipulate.php",
type:"POST",
data:"actionfunction=showData",
cache: false,
success: function(response){
$('#demoajax').html(response);
createInput();
}
});
Now I want to add a parameter so that the line: url:"DbManipulate.php" becomes url:"DbManipulate.php?q=[some value]
I tried to alter the script like this:
var cat=2;
$(function(){
$.ajax({
url:"DbManipulate.php?q="+cat.val(),
type:"POST",
data:"actionfunction=showData",
cache: false,
success: function(response){
$('#demoajax').html(response);
createInput();
}
});
But it doesn't work. The variable cat never gets into the function. How to pass the variable "cat" so that the DbManipulate.php file receives the $q variable and I can use it using $_GET?
Thank you