hi I am currently working on simple passing of variable value from a Javascript/Jquery variable to a php file.
function show(str){
if (str == "") {
document.getElementById("div_window").innerHTML="";
return;
}else if(str != ""){
var xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function() {
if (this.readyState==4 && this.status==200) {
document.getElementById("div_window").innerHTML=this.responseText;
}
}
xmlhttp.open("GET","server.php?q="+str,true);
xmlhttp.send();
}
}
the code above is the only thing i used up until now, but it is for retrieving of html, how do i start to use ajax for simple passing of variable value? where should i start and are there articles you can recommend?