1.新建 a.html
复制代码 代码如下:
<!doctype html>
<html>
<head>
<meta charset='utf-8'>
<title>iframe式ajax调用</title>
</head>
<body>
<form action='b.php' method='post' target='formTarget'>
<input type='text' placeholder='' value='' />
<input type='submit' value='提交' />
<span></span>
</form>
<iframe src=''></iframe>
</body>
</html>
复制代码 代码如下:
<?php
echo "
<script>
parent.document.getElementById('msg').innerHTML = 'iframe式ajax调用成功!';
alert('您输入的是:{$_POST['username']}');
window.setTimeout(function(){
parent.window.location.reload();
},3000);
</script>
";
新闻热点
疑难解答
图片精选