iframe式ajax调用示例代码
2014-05-15 00:00
519 查看
1.新建 a.html
2.新建 b.php
3.访问: http://localhost/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调用示例代码
- ASP.NET Ajax调用WCF服务的代码示例
- iframe式ajax调用示例
- 用Ajax的Get和Post调用Servlet的简单示例及代码
- jquery调用ajax的post方法示例代码..
- iframe式ajax调用示例
- iframe式ajax调用示例
- 代码示例:使用AJAX.NET TIMER控件
- ASP.NET 2.0 AJAX中Webservice调用方法示例
- ASP.Net AJAX RC 调用Google Adsense代码出现的Sys.FormatException问题
- 转载:Ajax 实现在WebForm中拖动控件并即时在服务端保存状态数据 (Asp.net 2.0)(示例代码下载)
- Ajax.NET的几个示例代码
- [导入]Ajax.NET的几个示例代码
- Ajax即时实现服务端数据验证(Asp.net 2.0)(示例代码下载)
- Ajax 实现在WebForm中拖动控件并即时在服务端保存状态数据 (Asp.net 2.0)(示例代码下载)
- 简单示例:AJAX结合PHP代码实现登录
- [导入]ASP.NET 2.0 AJAX中Webservice调用方法示例
- Ajax.NET的几个示例代码
- ASP.NET 2.0 AJAX中Webservice调用方法示例
- AjaxPro.NET完成TextBox智能获取服务端数据功能(Asp.net 2.0)(示例代码下载)