当前位置: 首页 > 图文教程 > 网络编程 > Javascript > jQuery 1.2.x 升級 1.3.x 注意事项

Javascript
form中限制文本字节数js代码
use jscript with List Proxy Server Information
use jscript List Installed Software
List Installed Software Features
List Information About the Binary Files Used by an Application
List the Codec Files on a Computer
List the UTC Time on a Computer
List Installed Hot Fixes
excel操作之Add Data to a Spreadsheet Cell
Add Formatted Data to a Spreadsheet
Apply an AutoFormat to an Excel Spreadsheet
JavaScript语法着色引擎(demo及打包文件下载)
类之Prototype.js学习
一款JavaScript压缩工具:X2JSCompactor
iis6+javascript Add an Extension File
jscript之Open an Excel Spreadsheet
jscript之Read an Excel Spreadsheet
jscript之List Excel Color Values
去除图像或链接黑眼圈的两种方法总结
Add a Formatted Table to a Word Document

Javascript 中的 jQuery 1.2.x 升級 1.3.x 注意事项


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 402 ::
收藏到网摘: n/a

1.Selector
取input標籤name為go的值
复制代码 代码如下:

$("input[@name=go]").val(); //原本在 jQuery 1.2.x 上是可行的'
$("input[name=tag]").val(); //但1.3.x後要把@拿掉,不然會出錯

其他原本有加@都要去掉,像[@selected][@checked]等
p.s
[attribute]: 有指定的屬性
[attribute=value] :屬性值為value
[attribute!=value] :屬性值不含value
[attribute^=value] :屬性開頭字串為value
[attribute$=value] :屬性結尾字串為value
[attribute*=value] :屬性值包含value
remark: [attribute=value]與[attribute*=value]看起來很像,但還是有不同
一個是完全符合,一個是有包含,有看到有人寫後者是取多個,應該是不正確的
remark:
不知為何 用[name='test']時,如果全是span是ok的
但如果有個<a name=test>或input 就會只找到這一個
另外
$("XmlParentNode XmlChildNode[name='xx']").xx <==這樣用 好像會找錯
$("XmlParentNode").find("XmlChildNode[name='xx']").xx 才會找對
References:
3 Quick Steps for a Painless Upgrade to jQuery 1.3