iframe式ajax调用示例代码
2018-10-12 14:08
232 查看
1.新建 a.html
<!doctype html>
<html>
<head>
<meta charset='utf-8'>
<title>iframe式ajax调用</title>
</head>
<body>
<form action='b.php' method='post' name='' id='' target='formTarget'>
<input type='text' name='username' id='' placeholder='' value='' />
<input type='submit' name='' value='提交' />
<span id='msg'></span>
</form>
<iframe src='' name='formTarget' id='formTarget' style='display:none'></iframe>
</body>
</html>
2.新建 b.php
<?php
echo "
<script>
parent.document.getElementById('msg').innerHTML = 'iframe式ajax调用成功!';
alert('您输入的是:{$_POST['username']}');
window.setTimeout(function(){
parent.window.location.reload();
},3000);
</script>
3.访问: http://localhost/a.html
您可能感兴趣的文章:
相关文章推荐
- iframe式ajax调用示例代码
- iframe式ajax调用示例
- jquery调用ajax的post方法示例代码..
- iframe式ajax调用示例
- ASP.NET Ajax调用WCF服务的代码示例
- iframe式ajax调用示例
- 用Ajax的Get和Post调用Servlet的简单示例及代码
- jQuery中$.ajax$()方法的参数详解及示例代码
- C#调用EasyPusher推送到EasyDarwin流媒体服务器直播方案及示例代码整理
- 调用 ajax调用出来的页面的 js代码
- [导入]Ajax.NET的几个示例代码
- ajax 调用后台接口示例
- 用java代码调用名片识别接口示例代码
- ASP.NET中AJAX 调用实例代码
- 快递鸟物流查询接口API调用代码示例
- Ajax.NET的几个示例代码
- ASP.NET AJAX中Webservice调用方法示例
- 实现ajax的异步调用代码
- AJAXPro用法,关于JS同步和异步调用后台代码的学习
- 使用代码调用ffmpeg示例