tag:blogger.com,1999:blog-2908475840373457869.post4589827329150815700..comments2014-05-01T18:24:38.622-07:00Comments on Milan Adamovsky's Blog: jQuery Plugin Pattern 2.1Milan Adamovskyhttp://www.blogger.com/profile/14821107775101468010noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-2908475840373457869.post-4129960466496285152011-08-12T21:03:47.500-07:002011-08-12T21:03:47.500-07:00Thanks Ludvig for the patch :) I will take some ti...Thanks Ludvig for the patch :) I will take some time and fix it on this page too !!!Milan Adamovskyhttps://www.blogger.com/profile/14821107775101468010noreply@blogger.comtag:blogger.com,1999:blog-2908475840373457869.post-52521612651671577452011-06-29T11:25:40.348-07:002011-06-29T11:25:40.348-07:00Here&#39;s a solution for using the pattern with j...Here&#39;s a solution for using the pattern with jQuery 1.5 and 1.6:<br /><br />http://ludw.se/blog/articles/19/patching-milans-jquery-plugin-pattern-for-jquery-16Ludvighttp://ludw.senoreply@blogger.comtag:blogger.com,1999:blog-2908475840373457869.post-90718924973003511112011-06-16T11:12:22.189-07:002011-06-16T11:12:22.189-07:00I have a question: If I use jQuery(selector).myPlu...I have a question: If I use jQuery(selector).myPlugin, I get the jQuerify function, right? This function has all methods of my class, so I can call jQuery(selector).myPlugin.someMethodA(). Cool. But in someMethodA, &#39;this&#39; refers to jQuerify, right? So how do I get access to jQuery methods, like &#39;each&#39;?Ittay Drorhttps://www.blogger.com/profile/06786072335349487451noreply@blogger.comtag:blogger.com,1999:blog-2908475840373457869.post-20662569798487469972011-04-21T22:45:06.810-07:002011-04-21T22:45:06.810-07:00Follow up : the issue seems to only occur with jqu...Follow up : the issue seems to only occur with jquery 1.5.x. Switching to 1.4.x fixes the problem. Do you have a fix for this in your pattern ?<br /><br />Thanks<br /><br />SebastienSebastienhttps://www.blogger.com/profile/00814353554281685548noreply@blogger.comtag:blogger.com,1999:blog-2908475840373457869.post-44563022689082616382011-04-21T15:59:15.376-07:002011-04-21T15:59:15.376-07:00Hi, I&#39;ve been very carefully (and slowly) read...Hi, I&#39;ve been very carefully (and slowly) reading your article son jquery plugin pattern. Very interesting stuff for someone just getting into pluin development (and on a deadline :s ).<br /><br />When using the 2.1 version however, it seems to break jquery. I&#39;m simply loading jQuery, the bare plugin. Then doing a simple :<br /><br />jQuery(document).ready(function($) { <br /> console.log($(&quot;div&quot;));<br />});<br /><br />trows an error in jquery.min.js : <br />&quot;Uncaught TypeError: Cannot call method &#39;find&#39; of undefined&quot;.<br /><br />Any ideas?Sebastienhttps://www.blogger.com/profile/00814353554281685548noreply@blogger.comtag:blogger.com,1999:blog-2908475840373457869.post-75849982267266440102011-03-06T22:53:04.769-08:002011-03-06T22:53:04.769-08:00what if I have some public methods for the class t...what if I have some public methods for the class that wouldn&#39;t need any &quot;selector&quot; to be passed in? For example: $.pluginName(&#39;methodName&#39;, args);Vu Nguyenhttps://www.blogger.com/profile/06518364289281426124noreply@blogger.comtag:blogger.com,1999:blog-2908475840373457869.post-9862841643908797182011-03-02T08:18:57.957-08:002011-03-02T08:18:57.957-08:00Hi Milan,
I really like your design goal, but I c...Hi Milan,<br /><br />I really like your design goal, but I cannot seem to get the plugins to work with jQuery 1.5.1.<br /><br />Which version of jQuery are you using? I tried plugin version 1.0, 2.0, and 2.1, they all have some issue.<br /><br />1.0 Passes the wrong &#39;this&#39;, the plugin does not crash anything, but the rest of the code is not working properly since it is expecting another DOM element (the selected one).<br /><br />2.0 and 2.1 cause some internal jQuery crash, I copied both plugins, as-is, and i get the following error in Safari ( 5.0.3 ):<br /><br />TypeError: Result of expression &#39;(e||f)&#39; [undefined] is not an object.Aron Allenhttp://aronallen.comnoreply@blogger.comtag:blogger.com,1999:blog-2908475840373457869.post-52588666556620225982011-02-08T07:17:49.356-08:002011-02-08T07:17:49.356-08:00Hello, Milan.
This pattern don&#39;t work with jqu...Hello, Milan.<br />This pattern don&#39;t work with jquery 1.5 when selector find several objects.bragovohttps://www.blogger.com/profile/10353146938330070421noreply@blogger.comtag:blogger.com,1999:blog-2908475840373457869.post-46549072652926784132011-02-07T17:07:49.045-08:002011-02-07T17:07:49.045-08:00Milan, this is really interesting stuff. I read yo...Milan, this is really interesting stuff. I read your previous posts on v1 and v2. There was a lot of discussion on those but nothing on this for some reason. <br /><br />How has this pattern been working out for you? Is it the Holy Grail or should we be expecting another version soon? <br /><br />Have you released any working plugins using this pattern that we could try?Erick Hoppehttp://www.erickhoppe.com/noreply@blogger.comtag:blogger.com,1999:blog-2908475840373457869.post-1168828660259451352011-02-07T08:42:08.354-08:002011-02-07T08:42:08.354-08:00Hi, Milan!
For example: $(&#39;#check&#39;).async...Hi, Milan!<br /><br />For example: $(&#39;#check&#39;).asyncLoader();<br />How in &quot;someMethodA&quot; I can find object for $(&#39;#check&#39;)?bragovohttps://www.blogger.com/profile/10353146938330070421noreply@blogger.com