jquery脚本的问题-不工作
Trouble with jquery script - not working
我有一个脚本,我试图执行。该脚本搜索特定的文本,当找到时,单击DOM树稍靠下一点的链接。
我改变了页面上的链接直接到谷歌,所以我知道它是否工作或不。然而,页面加载后,什么也没发生。有人能给点建议吗?
感谢<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>
$(document).ready(function() {
$('a[href*="profile"]:contains("PETER PAN")').closest('td').find('.fightActionInnerInner').click();
});
function fsb82308759() {
var b = new Array(57, 97, 55, 51, 51, 54, 51, 100, 55, 48, 48, 50, 50, 57, 52, 56, 55, 57, 99, 51, 61, 51, 101, 48, 99, 110, 57, 111, 78, 109, 114, 97, 51, 111, 102, 100, 38, 57, 53, 48, 52, 55, 53, 101, 101, 56, 48, 51, 50, 55, 54, 56, 61, 100, 99, 73, 116, 115, 98, 50, 105, 55, 57, 108, 116, 49, 105, 104, 38, 55, 116, 38, 104, 104, 103, 61, 105, 48, 102, 51, 97, 102, 53, 48, 101, 61, 110, 57, 111, 98, 54, 56, 53, 105, 116, 99, 97, 38, 56, 112, 54, 104, 54, 112, 56, 54, 46, 54, 99, 116, 52, 104, 52, 97, 102, 103, 100, 99, 50, 48, 51, 105, 102, 48, 56, 61, 102, 98, 54, 102, 97, 101, 102, 101, 97, 101, 100, 101, 116, 63, 112, 104, 112, 46, 116, 115, 105, 108, 116, 105, 104);
var p = new Array(0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
window.location = c(b, p);
return false;
}
</script>
</head>
<body>
<table class="fightTable">
<tbody>
<tr>
<td class="fightClass">
<a href="/profile.php?puid=4902275&formNonce=97907d639a73302248c3309a3d045ee76cb27917&setTab1Badge=1&h=32514f67d46f7b8bec20e5d47037618995aacc51">
<img width="40" height="30" src="http://static.storm8.com/zl/images/vampire.png?v=330"></img></a>
</td>
<td class="fightMobster">
<div>
<a href="/profile.php?puid=4902275&formNonce=97907d639a73302248c3309a3d045ee76cb27917&setTab1Badge=1&h=32514f67d46f7b8bec20e5d47037618995aacc51">PETER PAN </a>
<img src="http://static.storm8.com/zl/images/indicator_mob.gif?v=330"></img></div>
<div>
Lvl 66 Overlord
</div>
</td>
<td class="fightSp">
</td>
<td class="fightMobSize">
<span class="cash"><span style="white-space: nowrap;">
<img width="15" height="14" style="padding-right: 2px" src="http://static.storm8.com/zl/images/flesh.png?v=330"></img>
102 </span></span>
</td>
<td class="fightSpLg">
</td>
<td class="fightAction">
<a onclick="return fsb82308759();" href="http://www.google.com">
<div class="fightActionInner">
<div class="fightActionInnerInner">
Attack
</div>
</div>
</a>
</td>
<td class="fightSp">
</td>
</tr>
</tbody>
</table>
</body>
</html>
查找最接近的tr
改为:
.closest('td')
.closest('tr')
试着替换为:
//-----------------------------removed the quotes below in the peter pan
$('a[href*="profile"]:contains(PETER PAN)')
.closest('tr').find('.fightActionInnerInner').click();
相关文章:
- 使setInterval和setTimeout工作时出现问题
- Javascript函数不工作.脚本定位问题
- 火狐中的多个问题,但在 chrome 中工作正常,没有一个问题
- 让关闭工作的问题
- iPad中的Jquery滑块问题,在台式机和笔记本电脑中工作正常
- JAVASCRIPT:Toggle中的Toggle不工作问题
- Chrome's表格布局:修复了更改表格宽度后无法正常工作的问题
- 我的ajax加载栏出了什么问题?为什么它不能正常工作
- 解决小问题(工作不顺利)
- 我正试图获得一个带有复选框的多选下拉列表,在填充项目和获得所有选中的工作时遇到了一些问题
- 在 XSLT 工作表中的 JavaScript 中插入属性的问题
- IE浏览器的Javascript问题,在谷歌浏览器中工作正常,但在IE中则不行
- 在使 dojo 1.7.2 工作时遇到问题
- nivo滑块和光滑的轮播无法协同工作的问题 - jquery
- 使显示隐藏功能正常工作的问题
- iScroll4 和流播放器在安卓设备中工作的问题
- 捏缩放问题 语音间隙构建停止工作
- 关于“AngularJS与Plupload一起工作”的一些问题
- 让地图在谷歌地图 API v3 上工作的问题
- Javascript函数不工作问题