I have a javascript variable that I need to pass to a php variable. Since PHP is server-side, I figured the only way to send the js variable is to refresh. However, I don't want to reload the page. How can I send a javascript variable to php on the same page without reloading? For example, I want to assign the js variable "com" to the PHP variable "$com".
Thanks,
Jazzo
P.S. So far, I've defined my Ajax request as such:
Code:
req = (function () {
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
}
else if (window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
}
else {
return null;
}
}());