Can I give jQuery a variable with the .ajax method?
Now I have something like this:
<button onclick="sendQuery()">
function sendQuery(){
$.ajax({
type: "GET",
url: "action.php",
async: false,
data: {id: 560,
message: "Some message to you"
}
}
But is it possible to do like this way:
<button onclick="sendQuery(560, 'Some message to you')">
function sendQuery(myId, myMessage){
$.ajax({
type: "GET",
url: "action.php",
async: false,
data: {id: myId,
message: myMessage
}
}