I've script like this
$(function(){
//attach autocomplete
$("#user_key").autocomplete({
//define callback to format results
source: function(req, add){
//pass request to server
$.getJSON("/ajax/user_autocomplete.php?user_key=?",req, function(data){
//create array for response objects
var suggestions = [];
//process response
$.each(data, function(i, val){
suggestions.push(val.name);
});
//pass array to callback
add(suggestions);
});
}
});
});
and want to send one param to php file for receiving answer , how can I do it within this script ? and is it neccessary to have in html for method="get" or doen't it matter ?
I've to write {param: $(this).val} instead of req or how ?