1、通过ajax加载出来的节点,执行click事件。
1)需要用on委托给父级或者document。
2)委托后,Android可以执行click,苹果手机不能使用click,需要用touchstart。
3)苹果手机不使用touchstart,则需要吧该节点的样式修改为coursor:pointer;
2、serialize() 方法通过序列化表单值,创建 URL 编码文本字符串。
也可以选择一个或多个表单元素(比如 input 及/或 文本框),或者form元素本身。
序列化的值可在生成 AJAX 请求时用于 URL 查询字符串中。
eg:$(selector).serialize();
$('#form').submit(function() {
$.ajax({
type:'POST',
data:$(this).serialize();,
url:'medicine/addMedicine',
dataType:'json',
success:function(data){
if(data.Status==200){
//do something
}
}
});
});
3、对象转化为json。
JSON.stringify(Obj);
1)需要用on委托给父级或者document。
2)委托后,Android可以执行click,苹果手机不能使用click,需要用touchstart。
3)苹果手机不使用touchstart,则需要吧该节点的样式修改为coursor:pointer;
2、serialize() 方法通过序列化表单值,创建 URL 编码文本字符串。
也可以选择一个或多个表单元素(比如 input 及/或 文本框),或者form元素本身。
序列化的值可在生成 AJAX 请求时用于 URL 查询字符串中。
eg:$(selector).serialize();
$('#form').submit(function() {
$.ajax({
type:'POST',
data:$(this).serialize();,
url:'medicine/addMedicine',
dataType:'json',
success:function(data){
if(data.Status==200){
//do something
}
}
});
});
3、对象转化为json。
JSON.stringify(Obj);