I have a javascript function which runs when a script button is clicked,
//script function
oyCrosswordFooter.prototype.update = function(){
var buf = "";
if (!this.puzz.started){
buf += "Game has not yet started!";
} else {
buf += this.puzz.menu.score ; //this is the value I want to pass to a php file
if(this.puzz.menu.rank != -1){
buf += this.puzz.menu.rank;
}
}
document.getElementById("oygFooterStatus").innerHTML = buf;
}
I want to pass value of the 'buf' to another php file(let's say a.php) since I need to store it in a database when the button is clicked. Can anyone please tell me how to do this? If anyone can please post the complete answer since I am new to javascript.
Note that above function is in a .js file(file format is .js)