View Single Post
Old 08-13-2009, 01:08 PM   PM User | #3
Uzbekjon
New Coder

 
Join Date: Feb 2009
Location: Uzbekistan
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Uzbekjon is an unknown quantity at this point
The problem is that javascript can not find heartbeat() when it's being run. You should either declare your function out of the plugin (global namespace) or refer to your function with the full path ($.plugin.func()). Of course you'd need to rewrite your code a little...

Code:
function heartbeat() { ... };

$.Plugin = function(obj,opt)
{
     init();
     
     function init() { ... };

     setTimeout('heartbeat();', 1000);
}
Uzbekjon is offline   Reply With Quote