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
I made a few minor spelling and grammar changes, but otherwise it's good.
--
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com
On 12/26/06, Jörn Zaefferer [EMAIL PROTECTED] wrote:
Hi folks,
just added the Custom Alias section to the plugin authoring guide. If
you
just added the Custom Alias section to the plugin authoring guide. If
you don't know about this yet, check it out. Anyway, please correct or
improve it!
Nice job, Jörn. That's a handy page.
___
jQuery mailing list
discuss@jquery.com
Authoring guidelines say Always use jQuery instead of $ inside your
plugin code - that allows users to change the alias for jQuery in a
single place. Does this mean only the first line jQuery.fn... or
should also extend be jQuery.extend()?
That means everywhere inside. So if you did
jQuery.fn.pluginMethod = function(options) {
var settings = $.extend({
stuff: [5, 3, 6, 1],
name: pete,
speed: 5
}, options || {});
// other plugin code
};
So far this is the shortest way to write that particular snippet, and
I'd like to see it in your plugins :-)
And
John Resig schrieb:
jQuery.fn.pluginMethod = function(options) {
var settings = $.extend({
stuff: [5, 3, 6, 1],
name: pete,
speed: 5
}, options || {});
// other plugin code
};
So far this is the shortest way to write that particular snippet, and
I'd like to see it in
This is cool, but as plugin developer I cannot assume the latest jQuery
SVN version, right?
Right - once this feature comes out (say, 1.0.3) then it would be more
acceptable to require it. I guess you could always just be on the safe
side and do || {}, at least until the release of 1.1 (to
Hi John!
And this is even shorter, plus there's one less variable being defined:
jQuery.fn.pluginMethod = function(settings) {
settings = jQuery.extend({
// stuff
}, settings);
};
As noted previously - make sure that you use jQuery.extend() instead
of $.extend().
Dave Methvin schrieb:
Still, if you're writing a plugin only for your personal (well, non-public)
use and you're not using prototype.js, then you can freely use $() in
plugins because there will be no conflict.
I like the idea of using $ for prototyping. When you go back and
refactor and
Authoring guidelines say Always use jQuery instead of $
inside your plugin code - that allows users to change the
alias for jQuery in a single place. Does this mean only
the first line jQuery.fn... or should also extend be
jQuery.extend()?
That means everywhere inside. So if you did
10 matches
Mail list logo