<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: jQuery Plugin Boilerplate</title>
	<atom:link href="http://stefangabos.ro/jquery/jquery-plugin-boilerplate-revisited/feed/" rel="self" type="application/rss+xml" />
	<link>http://stefangabos.ro</link>
	<description>web developer extraordinaire</description>
	<lastBuildDate>Wed, 22 May 2013 07:26:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Stefan Gabos</title>
		<link>http://stefangabos.ro/jquery/jquery-plugin-boilerplate-revisited/comment-page-3/#comment-3328</link>
		<dc:creator>Stefan Gabos</dc:creator>
		<pubDate>Tue, 23 Apr 2013 05:50:49 +0000</pubDate>
		<guid isPermaLink="false">http://stefangabos.ro/?page_id=800#comment-3328</guid>
		<description><![CDATA[in JavaScript the &quot;this&quot; keyword refers to the object on the left side of the &quot;.&quot; (dot). But because private methods are called without &quot;.&quot; (e.g. foo_private_method();) then &quot;window&quot; it&#039;s considered to be the caller (although, since this is a private method, you will not be able to call it from outside the object like window.foo_private_method();).]]></description>
		<content:encoded><![CDATA[<p>in JavaScript the &#8220;this&#8221; keyword refers to the object on the left side of the &#8220;.&#8221; (dot). But because private methods are called without &#8220;.&#8221; (e.g. foo_private_method();) then &#8220;window&#8221; it&#8217;s considered to be the caller (although, since this is a private method, you will not be able to call it from outside the object like window.foo_private_method();).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete Januarius</title>
		<link>http://stefangabos.ro/jquery/jquery-plugin-boilerplate-revisited/comment-page-3/#comment-3316</link>
		<dc:creator>Pete Januarius</dc:creator>
		<pubDate>Mon, 22 Apr 2013 01:28:59 +0000</pubDate>
		<guid isPermaLink="false">http://stefangabos.ro/?page_id=800#comment-3316</guid>
		<description><![CDATA[Hi Stefan,

Thanks very much for this article. I am looking at modelling my plugins on it. One thing I noticed which would be good to get your clarification:

When you call a private method, the scope inside the private method (ie. the &#039;this&#039; object) is equal to the Window object. Is this intended?

Cheers

Pete...]]></description>
		<content:encoded><![CDATA[<p>Hi Stefan,</p>
<p>Thanks very much for this article. I am looking at modelling my plugins on it. One thing I noticed which would be good to get your clarification:</p>
<p>When you call a private method, the scope inside the private method (ie. the &#8216;this&#8217; object) is equal to the Window object. Is this intended?</p>
<p>Cheers</p>
<p>Pete&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Gabos</title>
		<link>http://stefangabos.ro/jquery/jquery-plugin-boilerplate-revisited/comment-page-2/#comment-2924</link>
		<dc:creator>Stefan Gabos</dc:creator>
		<pubDate>Mon, 25 Feb 2013 07:11:49 +0000</pubDate>
		<guid isPermaLink="false">http://stefangabos.ro/?page_id=800#comment-2924</guid>
		<description><![CDATA[i get this from many people :) the recommended way is the way of jQuery; my way is the way it always was with JavaScript and, as you say, being also a PHP developer it really suits me.

You can see many more ways of doing this at http://jqueryboilerplate.com/]]></description>
		<content:encoded><![CDATA[<p>i get this from many people <img src='http://stefangabos.ro/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  the recommended way is the way of jQuery; my way is the way it always was with JavaScript and, as you say, being also a PHP developer it really suits me.</p>
<p>You can see many more ways of doing this at <a href="http://jqueryboilerplate.com/" rel="nofollow">http://jqueryboilerplate.com/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://stefangabos.ro/jquery/jquery-plugin-boilerplate-revisited/comment-page-2/#comment-2896</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Mon, 18 Feb 2013 12:40:51 +0000</pubDate>
		<guid isPermaLink="false">http://stefangabos.ro/?page_id=800#comment-2896</guid>
		<description><![CDATA[Like Harry I&#039;m also confused with the two main types jquery plugin developing.

1.) Your Type.
As a former PHP developer i would prefer to have an class-object.
So i really like your type of writing plugins.

2.) The jQuery recommended way
(http://docs.jquery.com/Plugins/Authoring/)

i Really like the way they call &quot;public&quot; methods.
especially that part:
&lt;pre&gt;&lt;code&gt;$.fn.tooltip = function( method ) {
    
    if ( methods[method] ) {
      return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
    } else if ( typeof method === &#039;object&#039; &#124;&#124; ! method ) {
      return methods.init.apply( this, arguments );
    } else {
      $.error( &#039;Method &#039; +  method + &#039; does not exist on jQuery.tooltip&#039; );
    }    
  
  };&lt;/code&gt;&lt;/pre&gt;

But how can i use this type of &quot;method-calls&quot; with OO Instances!?
I&#039;m confused with mixing the two types.
Is there any recommended way to do so?]]></description>
		<content:encoded><![CDATA[<p>Like Harry I&#8217;m also confused with the two main types jquery plugin developing.</p>
<p>1.) Your Type.<br />
As a former PHP developer i would prefer to have an class-object.<br />
So i really like your type of writing plugins.</p>
<p>2.) The jQuery recommended way<br />
(<a href="http://docs.jquery.com/Plugins/Authoring/" rel="nofollow">http://docs.jquery.com/Plugins/Authoring/</a>)</p>
<p>i Really like the way they call &#8220;public&#8221; methods.<br />
especially that part:</p>
<pre><code>$.fn.tooltip = function( method ) {
    
    if ( methods[method] ) {
      return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
    } else if ( typeof method === 'object' || ! method ) {
      return methods.init.apply( this, arguments );
    } else {
      $.error( 'Method ' +  method + ' does not exist on jQuery.tooltip' );
    }    
  
  };</code></pre>
<p>But how can i use this type of &#8220;method-calls&#8221; with OO Instances!?<br />
I&#8217;m confused with mixing the two types.<br />
Is there any recommended way to do so?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: keuluu</title>
		<link>http://stefangabos.ro/jquery/jquery-plugin-boilerplate-revisited/comment-page-2/#comment-2799</link>
		<dc:creator>keuluu</dc:creator>
		<pubDate>Mon, 11 Feb 2013 01:13:11 +0000</pubDate>
		<guid isPermaLink="false">http://stefangabos.ro/?page_id=800#comment-2799</guid>
		<description><![CDATA[Hi,
Thanks for this clear and powerful piece of code.
I&#039;m facing a problem with event delegation though...
How would you manage event delegation from within a private method targeting another private method ?
for example :
&lt;pre&gt;&lt;code&gt;var init_method = function() {
   $(obj).delegate(&#039;.trigger&#039;, &#039;click&#039;, handle_event);
}
var handle_event = function() {
   // do something
}&lt;/code&gt;&lt;/pre&gt;

thanks

Luc]]></description>
		<content:encoded><![CDATA[<p>Hi,<br />
Thanks for this clear and powerful piece of code.<br />
I&#8217;m facing a problem with event delegation though&#8230;<br />
How would you manage event delegation from within a private method targeting another private method ?<br />
for example :</p>
<pre><code>var init_method = function() {
   $(obj).delegate('.trigger', 'click', handle_event);
}
var handle_event = function() {
   // do something
}</code></pre>
<p>thanks</p>
<p>Luc</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vsync</title>
		<link>http://stefangabos.ro/jquery/jquery-plugin-boilerplate-revisited/comment-page-2/#comment-2127</link>
		<dc:creator>vsync</dc:creator>
		<pubDate>Thu, 25 Oct 2012 02:20:18 +0000</pubDate>
		<guid isPermaLink="false">http://stefangabos.ro/?page_id=800#comment-2127</guid>
		<description><![CDATA[what about plugins which are based on event delegation?
your post is a bit old, you should update it. the last part:

return this.each(function() {


is not good if I have million elements..]]></description>
		<content:encoded><![CDATA[<p>what about plugins which are based on event delegation?<br />
your post is a bit old, you should update it. the last part:</p>
<p>return this.each(function() {</p>
<p>is not good if I have million elements..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ChrisG</title>
		<link>http://stefangabos.ro/jquery/jquery-plugin-boilerplate-revisited/comment-page-2/#comment-1844</link>
		<dc:creator>ChrisG</dc:creator>
		<pubDate>Thu, 30 Aug 2012 05:29:46 +0000</pubDate>
		<guid isPermaLink="false">http://stefangabos.ro/?page_id=800#comment-1844</guid>
		<description><![CDATA[How do I access the actual element (e.g., input) in the init...

$(element) comes up undefined for me.

Thanks

Chris]]></description>
		<content:encoded><![CDATA[<p>How do I access the actual element (e.g., input) in the init&#8230;</p>
<p>$(element) comes up undefined for me.</p>
<p>Thanks</p>
<p>Chris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dmitriy</title>
		<link>http://stefangabos.ro/jquery/jquery-plugin-boilerplate-revisited/comment-page-2/#comment-1664</link>
		<dc:creator>Dmitriy</dc:creator>
		<pubDate>Mon, 16 Jul 2012 11:52:38 +0000</pubDate>
		<guid isPermaLink="false">http://stefangabos.ro/?page_id=800#comment-1664</guid>
		<description><![CDATA[the only reason why this form of writing for the easy use plug-in?]]></description>
		<content:encoded><![CDATA[<p>the only reason why this form of writing for the easy use plug-in?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Gabos</title>
		<link>http://stefangabos.ro/jquery/jquery-plugin-boilerplate-revisited/comment-page-2/#comment-1652</link>
		<dc:creator>Stefan Gabos</dc:creator>
		<pubDate>Fri, 13 Jul 2012 11:30:03 +0000</pubDate>
		<guid isPermaLink="false">http://stefangabos.ro/?page_id=800#comment-1652</guid>
		<description><![CDATA[see the answer &lt;a href=&quot;http://stackoverflow.com/questions/11449538/jquery-plugin-template?utm_source=twitterfeed&amp;utm_medium=twitter&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; :)]]></description>
		<content:encoded><![CDATA[<p>see the answer <a href="http://stackoverflow.com/questions/11449538/jquery-plugin-template?utm_source=twitterfeed&#038;utm_medium=twitter" rel="nofollow">here</a> <img src='http://stefangabos.ro/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dmitriy</title>
		<link>http://stefangabos.ro/jquery/jquery-plugin-boilerplate-revisited/comment-page-2/#comment-1646</link>
		<dc:creator>Dmitriy</dc:creator>
		<pubDate>Thu, 12 Jul 2012 11:58:06 +0000</pubDate>
		<guid isPermaLink="false">http://stefangabos.ro/?page_id=800#comment-1646</guid>
		<description><![CDATA[Ii don&#039;t understand in code, why whe declare pluginName like a method of jQuery object and then we declare pluginName like a method of object $.fn why we did that?]]></description>
		<content:encoded><![CDATA[<p>Ii don&#8217;t understand in code, why whe declare pluginName like a method of jQuery object and then we declare pluginName like a method of object $.fn why we did that?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
