随笔分类 -  jquery

摘要:jquery-json:https://code.google.com/p/jquery-json/var thing ={plugin:'jquery-json', version:2.3};var encoded = $.toJSON( thing );// '{"plugin":"jquery-json","version":2.3}'var name = $.evalJSON( encoded ).plugin;// "jquery-json"var version = $. 阅读全文
posted @ 2012-03-22 17:27 虎头 阅读(13695) 评论(0) 推荐(1)
摘要:一、获取选择的值$("#select_id").find("option:selected").text()$("#select_id").val()二、选中1. $("#select_id ").get(0).selectedIndex=1;//设置Select索引值为1的项选中2. $("#select_id ").val(4); //设置Select的Value值为4的项选中3. $("#select_id option[text='jQuery']") 阅读全文
posted @ 2012-03-22 15:31 虎头 阅读(518) 评论(0) 推荐(0)
摘要:官方文档地址:http://docs.jquery.com/Plugins/Validation官方下载地址:http://bassistance.de/jquery-plugins/jquery-plugin-validation/$(document).ready(function () { jQuery.validator.addMethod('CheckCheckBoxList', function (value, element) { var checkedLength = $("#" + chklMemberGuardianship + &quo 阅读全文
posted @ 2011-10-18 15:22 虎头 阅读(386) 评论(0) 推荐(0)
摘要:jQuery UI Autocomplete 的插件官方文档:http://jqueryui.com/demos/autocomplete/jQuery UI Autocomplete 的下载地址:http://jqueryui.com/download前台html代码View Code <html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title> <script type="text/jav 阅读全文
posted @ 2011-10-18 14:53 虎头 阅读(409) 评论(0) 推荐(0)
摘要:jQuery.each( object, callback,arg)each()函数是基本上所有的框架都提供了的一个工具类函数,通过它,你可以遍历对象、数组的属性值并进行处理。 jQuery和jQuery对象都实现了该方法,对于jQuery对象,只是把each方法简单的进行了委托:把jQuery对象作为第一个参数传递给jQuery的each方法。换句话说:jQuery提供的each方法是对参数一提供的对象的中所有的子元素逐一进行方法调用。而jQuery对象提供的each方法则是对jQuery内部的子元素进行逐个调用。 jQuery.prototype.each = function(fn, . 阅读全文
posted @ 2011-10-18 14:45 虎头
摘要:Once upon a time, all we needed to worry about was reducing Bytes and Requests and playing around with load order to make things faster. Nowadays, we are increasingly impacting one more major component in performance – CPU utilization. Using jQuery and other frameworks that make selecting nodes and 阅读全文
posted @ 2011-09-06 16:41 虎头 阅读(1063) 评论(0) 推荐(1)
摘要:1、基本选择器#id $("#test")选取id为test的元素.class $(".test")选取class为test的元素element $("p")选取所有的<p>的元素* 所以元素selector1,selector2,....,selectorN 2、层次选择器$("parent child") $("div span") 选取<div>下所有的<span>元素$("parent>child") $("div& 阅读全文
posted @ 2011-07-04 16:35 虎头 阅读(191) 评论(0) 推荐(0)