View Single Post
Old 02-17-2013, 05:31 PM   PM User | #1
purplegraveston
New to the CF scene

 
Join Date: Feb 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
purplegraveston is an unknown quantity at this point
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);
}
purplegraveston is offline   Reply With Quote