如何从PHP调用JavaScript函数?
如何从PHP调用JavaScript函数?<?php
jsfunction();
// or
echo(jsfunction());
// or
// Anything else?
以下代码来自xyz.html(单击按钮)它调用wait()在外部xyz.js..这,这个wait()调用Wa.php。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;
}}
和Wa.php<?php echo "
哪里loadxml()以同样的方式调用来自另一个PHP文件的代码。
这个loadxml()不是很好,但不是我想要的那样。