/**********************************************************************双击表格单元格 变 输入框**/
$("#table td").css("height","20px");
$("#table").find("td").bind("dblclick",function(){
var input ="<input type='text' id='temp' value="+$(this).text()+" >";
$(this).text("");
$(this).append(input);
$("input#temp").focus();
$("input").blur(function(){
if($(this).val()==""){
$(this).remove();
}else{
$(this).closest("td").text($(this).val());
}
});
/******************************************************************ajax提交数据**/
$("#submit").click(function(){
$.ajax({
type:"POST",
url:"../../www.baidu.com",
data:"name=zhang&password=tong",
success:function(msg){
alert(msg);
}
});
});
/***********************************************************************getJSON**/
$("#getjson").click(function(){
$.getJSON("<%=request.getContextPath()%>/jquery/ajaxTest_getJSON.action",function(data){
$.each(data, function(i,item){
alert(i);
$("#jquerydiv").append("<p> 姓名:"+item.name+" 密码:"+item.password+"</p>");
});
});
});
/*********************************************************************添加验证**/
//添加验证
function addValidata(){
var boolValidata = true;
var name = $("#name");
var password = $("#password");
if($.trim(name.val()) ==""){
name.focus();
name.attr("title","用户名不能为空!");
boolValidata = false;
}else if($.trim(password.val())==""){
password.focus();
password.attr("title","密码不能为空!");
boolValidata = false;
}else{
//
}
return boolValidata;
}
/****************************************************************jquery.from提交***/
//from 提交
$("#btsubmit").click(function(){
if(addValidata()){
//jquery from
var option = {
url : "<%=request.getContextPath()%>/jquery/ajaxTest_getJSON.action",
success : function(msg) {
}
};
$("#ajaxfrom").ajaxSubmit(option);//不行,加return false;
}
return fasle;
});
分享到:
相关推荐
jQuery常用方法jQuery常用方法jQuery常用方法jQuery常用方法
NULL 博文链接:https://newleague.iteye.com/blog/774908
JQUERY 常用 方法 大全 txt
Attribute: $(”p”).addClass(css中定义的样式类型); 给某个元素添加样式 $(”img”).attr({src:”test.jpg”,alt:”test Image”}); 给某个元素添加属性/值,参数是map $(”img”).attr(”src”,”test.jpg”);...
jquery中ajax常用的方法,jQuery ajax框架常用方法总结.docx
jquery 常用方法集合(没有例子,只是方法名)
常用的jquery插件大全 jquery-json.js jquery-validate.js jquery.js, jquery.form.js, jquery.jscrollpane.css jquery.mousewheel.js 等等
jQuery 常用方法,基于jquery 14 总结,有很详细的方法介绍,和案例展示,希望对你有帮助
整理了一套JQuery的常用方法,常用的选择器,各个选择器的区别,实际开发中遇到的问题,与解决问题的常用方法。
这里提供了常用的几个jquery版本文件,核心的版本,使用时直接粘贴复制相关的jquery文件即可
包含一些关于jquery的常用方法,比如 根据value选中单选框和复选框 ;根据value选select标签;获取选中的 select的value 等等
常用的jqueryajax 方法,内容全面并有实例
这个是本人总结整理的 jquery常用方法总结,里面有jQuery对象与dom对象的转换 的一些方法
jquery常用小例子jquery常用小例子jquery常用小例子jquery常用小例子jquery常用小例子jquery常用小例子jquery常用小例子
常用jQuery代码 jQuery 插件 jQuery菜单 jQuery焦点轮播 jQuery弹层代码 焦点轮播 tab标签切换代码 jQ图片浏览 说明:压缩包分为jQuery code 1,2,3三卷。 本压缩包为卷jQuery code 2
自己亲自整理的常用jquery 特效 共享
网站常用jquery效果 jquery控件 包括 日历控件、tab控件、进度调、对话框、窗口弹出等效果 /jquery-ui-1.8.4.custom/development-bundle/demos/index.html 从这里进入
Jquery-EasyUI-1.4 常用jquery