<a> post
来源:互联网 发布:dota2知乎 编辑:程序博客网 时间:2024/06/06 00:49
使用ajax来发起POST请求
HTML代码如下:
<a href="http://www.baidu.com" class="a_post">发起POST请求</a>
JQuery代码如下:
$(".a_post").on("click",function(event){ event.preventDefault();//使a自带的方法失效,即无法调整到href中的URL(http://www.baidu.com) $.ajax({ type: "POST", url: "url地址", contentType:"application/json", data: JSON.stringify({param1:param1,param2:param2}),//参数列表 dataType:"json", success: function(result){ //请求正确之后的操作 }, error: function(result){ //请求失败之后的操作 } });});
0 0
- <a> post
- a标签post提交
- Sample Post From a File
- Sample Post From a File
- Pursue a Post-graduate Degree
- This is a test post
- A标签发送post请求
- a 标签 使用post提交
- a标签 的post 传值,
- a标签发送post请求
- Simulate a Form POST Request Using WinInet
- This is a first post test
- this is a test post with Writer
- i will be a post graduate!!!!!!!!!
- A very good post on ASH.
- <a>标签模拟post提交方式
- a class do async http post task
- 用a标签post提交表单
- iterator与iterable接口之间的区别
- 乐观锁 悲观锁实例
- extern "c"的使用问题
- 国内几大物联网平台的分析http://www.cnblogs.com/ibrahim/p/baidu-iot-hub.html
- URAL 1044 Lucky Tickets. Easy! 搜索打表枚举
- <a> post
- kero入门学习总结
- GL/glu.h: No such file or directory
- LeetCode 322. Coin Change
- 剑指offer面试题11:数值的整数次方
- Xcode下的相对路径和绝对路径
- JPA概要
- getCurrentSession()
- android 相机的扫码以及生成二维码