$("标签名") //取html元素 document.getElementsByTagName("")
$("#ID") //取单个控件document.getElementById("")
$("div #ID") //取某个控件中 控件
$("#ID #ID") // 通过控件ID取其中的控件
$("标签.class样式名") //通过class来取控件
$("#ID").val(); //取value值
$("#ID").val(""); //赋值
$("#ID").hide(); //隐藏
$("#ID").show(); //显示
$("#ID").text(); //相当于取innerHTML
$("#ID").text(""); //相当于innerHTML=""
$("#ID").css("属性","值") //添加CSS样式
$("form#表单id").find("#所找控件id").end() //遍历表单
$("#ID").load("*.html") //载入一个文件
例如:
$("form#frmMain").find("#ne").css("border", "1px solid #0f0").end() // end()返回表单
.find("#chenes").css("border-top","3px dotted #00f").end()

$.ajax({ url: "Result.aspx", //数据请求页面的url
type:"get", //数据传递方式(get或post)
dataType:"html", //期待数据返回的数据格式(例如 "xml", "html", "script",或 "json")
data: "chen=h", //传递数据的参数字符串,只适合get方式
timeout:3000, //设置时间延迟请求的时间
success:function(msg)//当请求成功时触发函数
{
$("#stats").text(msg);
},
error:function(msg) //当请求失败时触发的函数
{
$("#stats").text(msg);
}
});
$(document).ready(function(){
$("#description").mouseover(function(){
//ajax方法
$.get( "Result.aspx", //数据请求页面的url
{ chen: "测试",age:"25"}, //传递数据的参数字符串
function(data){ alert("Data Loaded: " + data); } //触发后的函数
);
});
});
//取得下拉选单的选取值
$(#testSelect option:selected').text(); //取文本值
或$("#testSelect").find('option:selected').text();
或$("#testSelect").val();
SELECT * FROM JOBS a WHERE not EXISTS(SELECT 1 FROM JOBS B WHERE a.job_id<b.job_id and B.MIN_LVL=A.MIN_LVL)
SELECT * FROM JOBS a WHERE EXISTS(SELECT 1 FROM JOBS B WHERE a.job_id<b.job_id and B.MIN_LVL=A.MIN_LVL)

以上就是【jQuery 使用个人心得】的全部内容了,欢迎留言评论进行交流!

赞(0) 踩(0)
发表我的评论

最新评论

  1. 暂无评论