如何从PHP调用JavaScript函数?
<?php jsfunction(); // or echo(jsfunction()); // or // Anything else?
wait()
wait()
function wait() { xmlhttp=GetXmlHttpObject(); var url="wait.php"; \ xmlhttp.onreadystatechange=statechanged; xmlhttp.open("GET", url, true); xmlhttp.send(null);} function statechanged(){ if(xmlhttp.readyState==4) { document.getElementById("txt").innerHTML=xmlhttp.responseText; }}
<?php echo "<script> loadxml(); </script>";
loadxml()
loadxml()
红颜莎娜