JQuery速查表
[b][url]http://www.gbsou.com/jquery-fact-sheet[/url][/b]
[b][url]http://docs.jquery.com/Main_Page[/url]
[url]http://api.jquery.com/[/url][/b]
[url]http://visualjquery.com/[/url]
[url]http://interface.eyecon.ro/[/url]
[url]http://tablesorter.com/docs/[/url]
jquery min lite pack各版本的说明:[quote]
jquery min lite pack各版本的说明:
jquery.js 全功能未压缩 开发者使用
jquery.lite.js [lite英文是精简版 未压缩 将注释去掉]
jquery.min.js [min 英文最小版 精简版的压缩]
jquery.pack.js [全功能有压缩,]
pack压缩表示:浏览器及服务器端支持gzip 这样下载速度会很快.
[/quote]
[b]jQuery对象和DOM对象的相互转换:[/b]
[url]http://www.cnblogs.com/z-yy/archive/2012/07/17/2594963.html[/url]
[url]http://www.cnblogs.com/ycbk/archive/2011/02/28/1967242.html[/url]
[color=red][b]jquery的$("#formId").validate()里rules所指定的为element元素的name属性。[/b][/color]
jQuery Selectors:
[b][url]http://api.jquery.com/category/selectors/[/url][/b][quote][b]If you wish to use any of the meta-characters ( such as !"#$%&'()*+,./:;<=>?@[\]^`{|}~ ) as a literal part of a name, you must escape the character with two backslashes: \\. For example, if you have an element with id="foo.bar", you can use the selector $("#foo\\.bar"). [/b][/quote]页面有如下element:
为什么使用
$("#id")是 ID Selector:[url]http://api.jquery.com/id-selector/[/url]
$(".myClass")是Class Selector:[url]http://api.jquery.com/class-selector/[/url]
所以,当你使用 $("#fidsTextRefChannel.textFull") 时,jquery会认为[b]You are trying to access the #fidsTextRefChannel with a class textFull[/b]。
解决办法:
一 使用双反斜杠对id中的dot做转义:
#(hash) .(dot) 外其他常用的选择器:
空格(blank) : Descendant Selector [url]http://api.jquery.com/descendant-selector/[/url]
Help understanding JQuery Attribute Equals Selector:
[url]http://stackoverflow.com/questions/3814966/help-understanding-jquery-attribute-equals-selector[/url][quote]This selector:
[b]$(document).ready 和 $(window).load 的区别:[/b]
Daily Tip : Difference between $(document).ready and $(window).load in jQuery:
[url]http://web.enavu.com/daily-tip/daily-tip-difference-between-document-ready-and-window-load-in-jquery/[/url]
$(document).ready vs. $(window).load:
[url]http://4loc.wordpress.com/2009/04/28/documentready-vs-windowload/[/url]
[b][size=medium]jQuery Validation Plugin:[/size][/b]
[url]http://stackoverflow.com/questions/4936221/jquery-validate-plugin-on-div[/url][quote]The validation plugin is (currently) designed to work on a <form>, [b]and only on a <form>. [/b][/quote]
因为jquery的validation只能针对form,那对分组验证(即页面需要一步一步点击“下一步”,最后做提交)该怎么做那?一种解决思路如下:
[url]http://www.cnblogs.com/wangjq/archive/2011/03/13/1983024.html[/url]
或者:(待以后细看补充 ; search key:jquery individual validate)
[url]http://stackoverflow.com/questions/1495919/is-there-a-way-to-validate-individual-fields-in-jquery-not-the-whole-form[/url]
[url]http://stackoverflow.com/questions/7429349/using-jquery-how-do-i-validate-individual-elements-and-show-the-relevant-error-m[/url]
jQuery学习之:Validation表单验证插件:
[color=red][b][url]http://polaris.blog.51cto.com/1146394/258781[/url][/b][/color]
客户端验证的极品--jQuery.validator:
[url]http://www.iteye.com/topic/255168[/url][quote]jquery内置的maxlength验证的是输入的字符的长度。可以用这个来验证输入域的字节长度:
jquery.validate的用法(自定义方法验证,服务端验证):
[url]http://hi.baidu.com/lxylxy888666/blog/item/ee96ab7b0c26f1f90ad18724.html[/url]
editable select list, plugin for jQuery:
[url]http://coffeescripter.com/code/editable-select/[/url]
下列代码:
在IE下,radio的onchange事件在radio change时并没有被触发!而是在焦点移至页面其他域后才触发!这是IE的问题。解决办法是在jquery的ready方法中加上下列代码:
[url]http://norman.walsh.name/2009/03/24/jQueryIE[/url][quote][b]If you click on a radio button, IE seems to wait with firing the change event until you leave the button[/b], which is consistent with the behavior on other input fields (like text), but kinda unintuitive. The following piece of code fixes this behavior for me:
[url]http://blog.csdn.net/borishuai/archive/2009/12/08/4967696.aspx[/url]
[b][url]http://www.gbsou.com/jquery-fact-sheet[/url][/b]
[b][url]http://docs.jquery.com/Main_Page[/url]
[url]http://api.jquery.com/[/url][/b]
[url]http://visualjquery.com/[/url]
[url]http://interface.eyecon.ro/[/url]
[url]http://tablesorter.com/docs/[/url]
jquery min lite pack各版本的说明:[quote]
jquery min lite pack各版本的说明:
jquery.js 全功能未压缩 开发者使用
jquery.lite.js [lite英文是精简版 未压缩 将注释去掉]
jquery.min.js [min 英文最小版 精简版的压缩]
jquery.pack.js [全功能有压缩,]
pack压缩表示:浏览器及服务器端支持gzip 这样下载速度会很快.
[/quote]
[b]jQuery对象和DOM对象的相互转换:[/b]
[url]http://www.cnblogs.com/z-yy/archive/2012/07/17/2594963.html[/url]
[url]http://www.cnblogs.com/ycbk/archive/2011/02/28/1967242.html[/url]
[color=red][b]jquery的$("#formId").validate()里rules所指定的为element元素的name属性。[/b][/color]
jQuery Selectors:
[b][url]http://api.jquery.com/category/selectors/[/url][/b][quote][b]If you wish to use any of the meta-characters ( such as !"#$%&'()*+,./:;<=>?@[\]^`{|}~ ) as a literal part of a name, you must escape the character with two backslashes: \\. For example, if you have an element with id="foo.bar", you can use the selector $("#foo\\.bar"). [/b][/quote]页面有如下element:
<textarea name="fidsTextRefChannel.textFull" id="fidsTextRefChannel.textFull" rows="7" style="width:100%"></textarea>
为什么使用
$("#fidsTextRefChannel.textFull")
时得不到该element?这与jquery的选择器Selector有关:
$("#id")是 ID Selector:[url]http://api.jquery.com/id-selector/[/url]
$(".myClass")是Class Selector:[url]http://api.jquery.com/class-selector/[/url]
所以,当你使用 $("#fidsTextRefChannel.textFull") 时,jquery会认为[b]You are trying to access the #fidsTextRefChannel with a class textFull[/b]。
解决办法:
一 使用双反斜杠对id中的dot做转义:
$("#fidsTextRefChannel\\.textFull")
二 使用Attribute Equals Selector:
$("textarea[id='fidsTextRefChannel.textFull']")
#(hash) .(dot) 外其他常用的选择器:
空格(blank) : Descendant Selector [url]http://api.jquery.com/descendant-selector/[/url]
Help understanding JQuery Attribute Equals Selector:
[url]http://stackoverflow.com/questions/3814966/help-understanding-jquery-attribute-equals-selector[/url][quote]This selector:
$('#myid .two td[role=foo]')
means: find the element with ID "myid". From it find all descendants with a class of "two". From those elements find all descendants <td> elements that have a role attribute with a value of "foo".[/quote]
[b]$(document).ready 和 $(window).load 的区别:[/b]
Daily Tip : Difference between $(document).ready and $(window).load in jQuery:
[url]http://web.enavu.com/daily-tip/daily-tip-difference-between-document-ready-and-window-load-in-jquery/[/url]
$(document).ready vs. $(window).load:
[url]http://4loc.wordpress.com/2009/04/28/documentready-vs-windowload/[/url]
[b][size=medium]jQuery Validation Plugin:[/size][/b]
[url]http://stackoverflow.com/questions/4936221/jquery-validate-plugin-on-div[/url][quote]The validation plugin is (currently) designed to work on a <form>, [b]and only on a <form>. [/b][/quote]
因为jquery的validation只能针对form,那对分组验证(即页面需要一步一步点击“下一步”,最后做提交)该怎么做那?一种解决思路如下:
[url]http://www.cnblogs.com/wangjq/archive/2011/03/13/1983024.html[/url]
或者:(待以后细看补充 ; search key:jquery individual validate)
[url]http://stackoverflow.com/questions/1495919/is-there-a-way-to-validate-individual-fields-in-jquery-not-the-whole-form[/url]
[url]http://stackoverflow.com/questions/7429349/using-jquery-how-do-i-validate-individual-elements-and-show-the-relevant-error-m[/url]
jQuery学习之:Validation表单验证插件:
[color=red][b][url]http://polaris.blog.51cto.com/1146394/258781[/url][/b][/color]
客户端验证的极品--jQuery.validator:
[url]http://www.iteye.com/topic/255168[/url][quote]jquery内置的maxlength验证的是输入的字符的长度。可以用这个来验证输入域的字节长度:
// 中文字两个字节
jQuery.validator.addMethod("byteRangeLength", function(value, element, param) {
var length = value.length;
for(var i = 0; i < value.length; i++){
if(value.charCodeAt(i) > 127){
length++;
}
}
return this.optional(element) || ( length >= param[0] && length <= param[1] );
}, "请确保输入的值在{0}-{1}个字节之间(一个中文字算2个字节)");
[/quote]
jquery.validate的用法(自定义方法验证,服务端验证):
[url]http://hi.baidu.com/lxylxy888666/blog/item/ee96ab7b0c26f1f90ad18724.html[/url]
editable select list, plugin for jQuery:
[url]http://coffeescripter.com/code/editable-select/[/url]
下列代码:
$(document).ready(function() {
$("input[name='fidsRuleParameter.type']").change(function() {
//alert($(this).val());
if($(this).val()=="I") {
$("#intValueUnitSpan").text("<s:text name='parameter.form.intValueUnit'/>");
} else {
$("#intValueUnitSpan").text("");
}
});
});
<td width="85%" align="left">
<input type="text" name="fidsRuleParameter.value" id="value" value="<s:property value="fidsRuleParameter.value"/>" class="intValueClass"/>
<span id="intValueUnitSpan"><s:if test='%{#request.fidsRuleParameter.type=="I"}'><s:text name='parameter.form.intValueUnit'/></s:if></span>
</td>
<tr bgcolor="#FFFFFF">
<td width="15%" align="right"><label for="stationCode"><s:text name='parameter.form.type'/>: </label></td>
<td width="85%" align="left">
<s:radio id="fidsRuleParameter.type" name="fidsRuleParameter.type" theme="simple"
list="#{'I':getText('parameter.grid.renderer.type.I'), 'S':getText('parameter.grid.renderer.type.S')}"/>
</td>
</tr>
在IE下,radio的onchange事件在radio change时并没有被触发!而是在焦点移至页面其他域后才触发!这是IE的问题。解决办法是在jquery的ready方法中加上下列代码:
/** fix that problem: If you click on a radio button, IE seems to wait with firing the change event until you leave the button **/
$(function () {
if ($.browser.msie) {
$('input:radio').click(function () {
this.blur();
this.focus();
});
}
});
相关链接:
[url]http://norman.walsh.name/2009/03/24/jQueryIE[/url][quote][b]If you click on a radio button, IE seems to wait with firing the change event until you leave the button[/b], which is consistent with the behavior on other input fields (like text), but kinda unintuitive. The following piece of code fixes this behavior for me:
$(function () {
if ($.browser.msie) {
$('input:radio').click(function () {
this.blur();
this.focus();
});
}
});
[/quote]在IE中关于Radio和Checkbox在JQuery中的change事件的立即触发:
[url]http://blog.csdn.net/borishuai/archive/2009/12/08/4967696.aspx[/url]