に文字が含まれているかどうかに基づいて、テーブル内のテーブルセルのスタイルを設定しようとしています。URLに含まれるかどうか(SharePointを扱う場合は質問しないでください)。
サンプルHTML;
<table>
<tr>
<td class="ms-cal-workitem">
<table>
<tr>
<td class="ms-cal-monthitem">
<a href="http://localhost:4657/1">Event 1</a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="ms-cal-workitem">
<table>
<tr>
<td class="ms-cal-monthitem">
<a href="http://localhost:4657/1|435348578-kfsd-sdfsf-sfsf-324ewwer">Event 2</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
ハイパーリンクを含むクラスms-cal-workitemのテーブルセルでは、背景色を赤にする必要があります。これに対する唯一の例外は、クラスms-cal-monthitemを持つ、文字|を持つハイパーリンクを含むテーブルセルです。彼らのhrefプロパティで。
私がこれまでに得たもの。
$(document).ready(function() {
$("td.ms-cal-workitem:has(a[href*='|'])").css("background-color", "#ffff99");
$("td.ms-cal-workitem:has(a:not[href*='|'])").css("background-color", "#ffcc33");
});