点击时调用下面代码就可以实现:<script LANGUAGE="JavaScript"> <!-- function openwin() { window.open ("list_conn_dj.php", "newwindow", "height=200, width=400, toolbar =no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no, top="+(window.screen.height-450)/2+", left="+(window.screen.width-450)/2+" ") // this.Response.Write("<script language=javascript> window.open ("list_conn_dj.php", "newwindow", "height=200, width=400, toolbar =no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no, top="+(window.screen.height-450)/2+", left="+(window.screen.width-450)/2+" ") </script>") } //--></script>
<html><head><script ...> function send_request() { //ajax发送查找数据库请求 //设置onready函数等待数据接收完成 //当数据接收完成,将<div id="data_recv"></div>之间的innerHtml设置为接受到的数据 //并显示该div(初始化时设置为隐藏) }</script></head><body>//搜索部分<div id="data_recv"></div></body></html>......php文件根据发送来的请求搜索数据库,并生成相应的 html,然后echo 之
$sql=""$query = mysql_query($sql);$count = mysql_result($query);echo "<script>alert(".$count.")</script>";