Just init with
setInterval(OnTimer, 1000 * 3600 ); // check once every hour
And in
function OnTimer()
you we just call what we created before.Same goes for menus; add a refresh menu item like this
plugin.onAddCustomMenuItems = AddCustomMenuItems
function AddCustomMenuItems(menu)
{
menu.AddItem(strMenuRefresh, 0, OnMenuRefresh);
}
function OnMenuRefresh(item_text)
{
OnTimer()
}
Easy, isn't it ?
technorati tags:google, javascript,
No comments:
Post a Comment