我正在下面选择在jQuery选择:有问题:包含IE8
$("div[id^=WebPartWPQ]:has(table.ms-sitedirresultssort) td:contains(' : ')").closest('div')
换句话说:选择带有ID的DIV开始WebPartWPQ
具有与ms-sitedirresultssort
类表中,有一个td包含文字:
。在这个问题的最后是由SharePoint呈现的HTML。
该选择器在Firefox 3.5下完美工作,但不在Internet Explorer 8下。我正在使用hide()
函数进行测试。
我已经缩小到选择器的td:contains(' : ')
部分。在Firebug Lite中运行$("td:contains(' : ')")
会抛出一些功能列表,例如某些内容无效。所有其他选择器在FB Lite中都可以正常工作。
我试过使用jQuery 1.3.2和jQuery 1.4rc1没有成功。这是jQuery中的一个bug,如果有的话,是否有票(我找不到)?任何想法如何最好地解决这个问题?
HTML:
<div style="" helpmode="1" helplink="/_layouts/help.aspx" allowdelete="false" class="ms-WPBody"
width="100%" id="WebPartWPQ4" haspers="false" webpartid="2ae67b12-82db-4238-8be9-cd4b39cbd15a">
<table cellspacing="0" cellpadding="0" border="0" width="100%" xmlns:crwp="urn:schemas-microsoft-com:CategoryResultsWebPart"
xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:x="http://www.w3.org/2001/XMLSchema"
class="ms-sitedirresultssort">
<tbody>
<tr>
<td width="100%" />
<td nowrap="">
<a href="#title">Sort by Title </a><span>| </span><a href="#url">Sort by Url </a>
</td>
</tr>
</tbody>
</table>
<table cellspacing="0" cellpadding="0" border="0" width="100%" xmlns:crwp="urn:schemas-microsoft-com:CategoryResultsWebPart"
xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:x="http://www.w3.org/2001/XMLSchema"
class="ms-sitedirresultspaging">
<tbody>
<tr>
<td> : </td>
</tr>
</tbody>
</table>
<table cellspacing="0" cellpadding="0" border="0" width="100%" xmlns:crwp="urn:schemas-microsoft-com:CategoryResultsWebPart"
xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:x="http://www.w3.org/2001/XMLSchema"
class="ms-sitedirresultsbody" id="table2">
<tbody>
<tr>
<td valign="top">
<img alt="" src="/_layouts/images/lstbulet.gif" />
</td>
<td width="100%" class="ms-sitedirresultstitle">
<a href="http://site/cd10/_layouts/mysite.aspx?Redirect=1">Setup MySite</a>
</td>
</tr>
<tr>
<td />
<td width="100%" class="ms-sitedirresultsurl">
<a dir="ltr" href="http://site/cd10/_layouts/mysite.aspx?Redirect=1">http://site/cd10/_layouts/mysite.aspx?Redirect=1</a>
</td>
</tr>
</tbody>
</table>
</div>
我对这里发布的HTML进行了修改,修改了''周围的空格。哎呦!无论如何,谢谢你回答我的错误。 – 2010-01-14 00:46:39