ページにいくつかのセクションがあり、継承したコードでは、フィルタを使用して特定のセクションにクリック イベントを追加します。セクションをクリックすると、コメント ボックスが表示されます。
$('section[data-actionid]').filter(function () {
var tpe = parseInt($(this).attr('data-actiontypeid'), 10);
//allow inner if not a like and not a wallpostcomment, i.e. end of the line
return (tpe % 100 !== Tm.action.Comment &&( tpe < 10000 || tpe > 20000));
}).on('click', function () {
var actionid = $(this).data('actionid');
var lic = $(this).find('li[data-actionid]:not([data-parentid])');
if (!lic || lic.length == 0) {
return;
}
var li = lic[0];
if (actionid) {
GetTMActionInner(li, actionid, objid, vwrsid, successGetTMActionInnerCallback, failureGetTMActionInnerCallback);
}
});
理想的には、特定のリンクをクリックして TMComment クラスを使用してこれを実行したいのですが、2 つを組み合わせる方法がわかりません。
そのクラスでフィルターを追加してanchor tag
、親セクションからフィルター処理する必要があるデータを取得する必要がありますか?それとももっと簡単な方法がありますか?