Hello friends how to pass a javascript variable to ajax and from ajax how we can pass it to the php page please give me an answer
Are you talking about a jQuery AJAX request or a regular Javascript HTTPRequest?
jquery ajax using the commands like
$.post(“execut.php”, {nick:nick}, function(data){
}
like this…
hello reply if any one knows pls …i am not getting how to pass an javascript variable value in this please any one…
$.post(“execut.php”, {nick:nick}, function(data){
}
Instead of function(data){…} you can return it instead from a separate function, so that it then has access to other passed variables.
function (someVar) {
// passedVar is now available as someVar
return function (data) {
// someVar is accessible from in here
...
}
}(passedVar)