すべてのページでトリガーされるこのカスタム プラグイン イベント コールバックがあります。
$(document).on('pjax:complete', all.myfunction);
myfunction を拡張したい: all.myfunction を呼び出してから特定のコードを呼び出す
// my specific page
$(document).on('pjax:complete', specific.myfunction);
specific.myfunction = function() {
all.myfunction();
/* code relative to this specific page */
}
これを達成するためのよりクリーンなアプローチはありますか?