If you only want the last time the function was called:

jQuery.debug; // Stores last called date for jQuery.fn.debug
jQuery.fn.debug = function() {
    jQuery.debug = new Date();
    return this.each(function() {
       alert(this);
    });
};

Other things like recording all previous calls and possibly including 
the number of elements or other useful information would be similarly 
accomplished but would use an array rather than a simple Date Object. 
And obviously the variable name I chose simply for style, it can be any 
variable you want it to be.

-blair

howard chen wrote:
> e.g.
>
> jQuery.fn.debug = function() {
> // i want to save the current time into a global variable?
>   return this.each(function(){
>     alert(this);
>   });
> };
>
> I want save the time of the last plugin being executed for later use,
> any recommened method?
>
> thanks.
>
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to