php + ajax 如何做出 点击按钮就能调另一个php文件并且把这个文件计算的值用对话框弹出来

来源:百度知道 编辑:UC知道 时间:2024/06/21 19:03:04
需要两个php页 a.php 有计算按钮b.php 有计算的程序 点a.php 时 调用 b.php 的代码 把计算结果显示出来

a.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh" lang="zh" dir="ltr">
<head profile="http://www.w3.org/2000/08/w3c-synd/#">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Page</title>
<script type="text/javascript">
function createXMLHttpRequest() {
if(window.XMLHttpRequest) { //Mozilla 浏览器
XMLHttpReq = new XMLHttpRequest();