当调用函数而不触及实际函数(jquery)时有回调吗?
我正在开发一个小插件,如果 Roundcubemail 中的邮箱中有未读消息,它可以更改图标。然而,该 API 很糟糕,并且仅在加载整个页面时才会触发 listupdate
事件,即使该事件本应在列表更新时触发。
但是,我设法发现,每次更新列表时,都会调用某些函数,例如 set_unread_count
。它很容易获得未读计数,因此以某种方式“附加”东西到这个函数会很棒。我只是认为根据几个小时的搜索,没有解决方案。我可以添加一个在调用 set_unread_count
时调用的回调吗?我可以以某种方式向该函数添加内容吗?还有其他想法吗?
I'm developing a small plugin that changes the favicons if there are unread messages in mailbox in Roundcubemail. However, the API sucks, and the event listupdate
is fired only when the whole page is loaded, even if it is meant to fire when the list is updated.
However, I've managed to find out, that every time the list is updated, certain functions are called, such as set_unread_count
. It gets the unread-count easily, so it would be great to somehow "append" stuff to this function. I just think based on hours of searching that there is no solution for this. Can I add a callback to be called when the set_unread_count
is called? Can I somehow append stuff to that function? Any other ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建一个小
钩子
。演示:http://www.jsfiddle.net/4yUqL/69/
Create a little
hook
.Demo: http://www.jsfiddle.net/4yUqL/69/