Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
パラメータとして整数を受け取る必要があるこのプラグインがあります
('foo').myplugin(3);
パラメータをプラグイン関数に渡すにはどうすればよいですか?
私はこのようなことを試しました -
$.fn.myplugin = function(int){ alert(int); } //suppose to alert "3"
それでも、うまくいかないようです
$ステートメントの最初に次のものが必要です。
$
$('foo').myplugin(3);
http://jsfiddle.net/NxP4p/