惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
W
WeLiveSecurity
O
OpenAI News
N
News and Events Feed by Topic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Webroot Blog
Webroot Blog
Google Online Security Blog
Google Online Security Blog
云风的 BLOG
云风的 BLOG
N
News | PayPal Newsroom
H
Hacker News: Front Page
博客园_首页
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
The Last Watchdog
The Last Watchdog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Heimdal Security Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Schneier on Security
宝玉的分享
宝玉的分享
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Y
Y Combinator Blog
Cyberwarzone
Cyberwarzone
Microsoft Security Blog
Microsoft Security Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
GbyAI
GbyAI
Cloudbric
Cloudbric
TaoSecurity Blog
TaoSecurity Blog
人人都是产品经理
人人都是产品经理
P
Palo Alto Networks Blog
M
MIT News - Artificial intelligence
G
GRAHAM CLULEY
C
Check Point Blog
Apple Machine Learning Research
Apple Machine Learning Research
Last Week in AI
Last Week in AI
T
Troy Hunt's Blog
L
Lohrmann on Cybersecurity
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
量子位
博客园 - 聂微东
S
Securelist
博客园 - 三生石上(FineUI控件)
F
Full Disclosure
G
Google Developers Blog
L
LINUX DO - 热门话题
P
Proofpoint News Feed
AI
AI
PCI Perspectives
PCI Perspectives

博客园 - Love Fendi

性能优化系列---查询高cup的sql State模式学习 8.17--8.24积累 sql server 2005 analysis service step by step(三):创建父子维度 sql server 2005 analysis service step by step(二):创建时间维度 sql serve 2005 analysis service step by step(一):创建标准维度 算法练习五:求数组中第k大的数 算法练习四:求N!不溢出 算法练习三:奇偶分割 算法练习二:二分查找 数据库锁 算法练习一:最大公约数与最小公倍数 索引优化 生成验证码,同时异步获取加密后的验证码 自定义控件中与脚本资源集成的若干处理方式 一条语句删除表中某字段重复的数据 动态按需异步加载js文件 在Nhibernate中使用Json.net中出现Self referencing loop的错误的处理 c#委托事件 入门
JQuery学习笔记
Love Fendi · 2008-12-29 · via 博客园 - Love Fendi

1.从$开始

对于熟悉prototype的朋友,$符号应该很熟悉,

prototype: var element = $(’eleId’)
jquery:
var element = $(’#eleId’)
DOM:
var element = document.getElementById(’eleId’)

以上三种选择方式是等价的,相比prototype来说jquery多了个#号
例:

$(’#j1′).html()

<div id=j1>Hello, jQuery!</content>

2.通过xpath+css来获取你想要的…
    1).
在这段例子中我们需要用到的

HTML代码

<div class=”contentToChange”>
    
<p class=”alert”>警告!警告!警告!警告!</p>
    
<p class=”firstParagraph”>我是第一段</p>
    
<p class=”secondParagraph”>第二段,哎,火箭输球了 0比33!火箭替补钉上耻辱柱 <em>姚麦</em>身边再无可用之人频繁失误成姚明致命毒药 板凳消失是火箭落后主因</p>
</div>

    2).

在这段例子中我们需要用到的HTML代码:

注:
$(’#jqdt ol.groof > strong’) 其中的>代表只访问下一级子节点中包含strong的元素,
如果改为 $(’#jqdt ol.groof strong’) 则访问所有下级子节点中的strong元素,包括子节点的子节点等。

3).
常用的自定义选择器
:eq(0) 选择索引等于0也就是第一个元素

   :gt(4) 选择所有索引大于4的元素

:lt(4) 选择所有索引小于4的元素

:first 等价于 :eq(0)

:last 选择最后一个元素

:parent 选择所有含有子节点的元素 (including text).

:contains(’test’) 选择含有指定文本的元素

:visible 选择所有可见元素(包含:display:block|inline,或者visibility为visible的元素,但是不包括表单元素(type hidden)

:hidden 选择所有隐藏元素(包含:display:none,或者visibility为hidden的元素,包括表单元素(type hidden)

例:

$(’p:first’).css(’fontWeight’,'bold’)
    $(’div:hidden’).show();
    $(
div:contains(’test’)).hide();

    $(’input[@name
=bar]’).val() //获取名字为bar的input表单的值
    $(’select[@name=slt]’).val() //获取名为slt的下拉菜单的选择中值
    $(’input[@type=radio][@checked]’) //获取所有被选中的radio表单

表单选择器

   :input Selects all form elements (input, select, textarea, button).

:text Selects all text fields (type=”text”).

:password Selects all password fields (type=”password”).

:radio Selects all radio fields (type=”radio”).

:checkbox Selects all checkbox fields (type=”checkbox”).

:submit Selects all submit buttons (type=”submit”).

:image Selects all form images (type=”image”).

:reset Selects all reset buttons (type=”reset”).

:button Selects all other buttons (type=”button”).

例:

   $(’myForm:input’)
   $(’input:radio’,myForm)
  
//:radio等价于[@type=radio]