2012年6月25日

jQuery获取Select选择的Text和Value

摘要: 语法解释:1. $(“#select_id”).change(function(){//code…}); //为Select添加事件,当选择其中一项时触发2. var checkText=$(“#select_id”).find(“option:selected”).text(); //获取Select选择的Text3. var checkValue=$(“#select_id”).val(); //获取Select选择的Value4. var checkIndex=$(“#select_id “).get(0).selectedIndex; //获取Select选择的索引值5. var ma 阅读全文

posted @ 2012-06-25 14:35 zhuhai 阅读(348) 评论(0) 推荐(0)

Jquery ajax执行顺序 返回自定义错误信息

摘要: 多个Ajax 在一个function中的执行顺序 由于Jquery中的Ajax的async默认是true(异步请求),如果想一个Ajax执行完后再执行另一个Ajax, 需要把async=false就可以了.代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->functionTestAjax(){varUserName=$("#txtUserName").val();$.ajax({url:"AjaxCheckUs 阅读全文

posted @ 2012-06-25 14:33 zhuhai 阅读(289) 评论(0) 推荐(0)

导航

我的百度空间