|
including php in javascript function
hi all, thanks in advance for looking...
im trying to run a javascript function that does one thing in a div called "idGenre" when the function is called and it works okay no probs, but i all, but now i also want it to somthing else when that function is called as well. I want it to call or include a php script in another <div> called "idMain" to run the script in that div too, i did it a long time ago but have forgotton how i did it, could you please help?
function fnGenre(genre){
var xmlhttp; if (window.XMLHttpRequest){ xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
var params = "genre="+genre;
xmlhttp.open("POST", "genre.php", true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", params.length);
xmlhttp.setRequestHeader("Connection", "close");
xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){
document.getElementById("idGenre").innerHTML=xmlhttp.responseText;
in here i want it to say somthing like ...
document.getElementById("idMain").include "show.php";
} }
xmlhttp.send(params);
}
|