博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
20151209jquery学习笔记Ajax 代码备份
阅读量:7254 次
发布时间:2019-06-29

本文共 1753 字,大约阅读时间需要 5 分钟。

/*$(function () {	$("input").click(function() {        $.ajax({			type:'POST',			url:'test.php',			data:{				url:'ycku'				},				success: function(response,status,xhr){					$("#box").html(response);					}			});    });});$(function () {	$('form input[type=button]').click(function() {        $.ajax({			type:'POST',			url:'user.php',			data:{				user:$('input[name=user]').val(),				email:$('input[name=email]').val()				},				success: function(response,status,xhr){					$("#box").html(response);					}			});    });});*//*表单序列化*/$(function () {	/*$('form input[type=button]').click(function() {        $.ajax({			type:'POST',			url:'user.php',			data:$("form").serialize(),				success: function(response,status,xhr){					$("#box").html(response);					}			});			alert($('form').serialize());//字符串形式的键值对,并且还对URL进行了编码    });	$('form input[name=sex]').click(function() {       //$('#box').html(decodeURIComponent($(this).serialize()))	   // $('#box').html($(this).serializeArray())	   //console.log($('#box').html($(this).serializeArray()))	   var json=$(this).serializeArray();	   $('#box').html(json[0].name+'='+json[0].value());    });	$('form input[type=button]').click(function() {		//初始化重复的属性		$.ajaxSetup({				type:'POST',			    url:'user.php',			    data:$("form").serialize(),				});        $.ajax({				success: function(response,status,xhr){					$("#box").html(response);					}			});						    });	*/	$('form input[type=button]').click(function() {        $.ajax({			type:'POST',			url:'user.php',			data:$.param({				user:$('input[name=user]').val(),				email:$('input[name=email]').val()				}),				success: function(response,status,xhr){					$("#box").html(response);					}			});    });});

  

转载于:https://www.cnblogs.com/xiaoduc-org/p/5034049.html

你可能感兴趣的文章
graphql-yoga interface && union 使用
查看>>
32.QT-制作最强电压电阻表盘,可以自定义阴影效果,渐变颜色,图标,文字标签等-附带demo程序...
查看>>
jquery tmpl 详解
查看>>
Linux iptables 命令
查看>>
bootstrap课程9 bootstrap如何实现动画加载进度条的效果
查看>>
Laravel 5.3 用户验证源码探究 (一) 路由与注册
查看>>
程序员考证之信息系统项目管理师
查看>>
scikit-learn学习笔记
查看>>
mybatis 传入多个参数
查看>>
opencv给图片添加文字水印<转>
查看>>
mysql查询表的数据大小
查看>>
初识Continuation
查看>>
smooth l1
查看>>
ET–异步协程使用–TimerComponent篇
查看>>
Linux LVM学习总结——Insufficient Free Extents for a Logical Volume
查看>>
智课雅思词汇---二十一、名词性后缀acity是什么意思
查看>>
JavaWeb 返回json数据的两种方式
查看>>
(转)Java 详解 JVM 工作原理和流程
查看>>
关于如何获得数据库数据变化的情况(比定时查询方便多了)
查看>>
阿里员工都是这样排查Java问题的,附工具单(转)
查看>>