Thank you so much! I have fixed items 1,2, and 3. For items 4 and 5, I had created an issue on the project site: http://code.google.com/p/postlink/issues/detail?id=1
I know I shouldn't use alerts (that was more for me when I was developing the plugin). I would prefer to just ignore any elements that aren't 'A' elements - can I just replace my alerts with "return;" ? Thank you very much for your valuable input! Brian On Jan 7, 9:19 am, "Richard D. Worth" <rdwo...@gmail.com> wrote: > On Tue, Jan 6, 2009 at 2:15 PM, BrianH <emilyandbr...@gmail.com> wrote: > > > I had a need for a certain functionality on my web page and thought I > > would try my hand at writing my first jQuery plugin (I'm sure that's > > how everyone gets their first plugin started). Since this is my first > > plugin, I would really appreciate it if I could get some feedback and > > criticism (be harsh, I can take it) on my plugin. Rather than pasting > > all the code in this post (I can if that is better), I started a > > google code project for it. > > > The project page is:http://code.google.com/p/postlink/ > > and the javascript file is: > >http://code.google.com/p/postlink/source/browse/trunk/jquery.postlink.js > > 1) Your usage example > > <script type="text/javascript" src="jquery.postlink-0.1.js"> > $(document).ready(function() { > $('a').postlink();}); > > </script> > > will only work if you've done something along these lines > > http://ejohn.org/blog/degrading-script-tags/ > > inside your plugin. My guess is you meant > > <script type="text/javascript" src="jquery.postlink-0.1.js"></script> > <script type="text/javascript"> > $(document).ready(function() { > $('a').postlink();}); > > </script> > > 2) Your google code project page describes what this plugin does, but says > nothing of why? In other words, why should I be interested? What is this > going to do for me? What would be the perfect situation for the application > of your plugin? > > 3) Line 11 > > $obj = $(this); > > Don't forget var > > 4) Line 13 > > alert("Cannot use postlink plugin on non 'A' elements"); > > This looks like a message intended for a developer that might use this > plugin, not a visitor to a web site (who would receive it nonetheless). > Throwing an exception won't be any better, in fact much worse, because the > developer (that decided to use your plugin) would have to know to catch the > exception or it would break the whole site/page. And if they know that, they > would know not to call it on anything but an 'A' element :). Best is > > - ignore something you don't support/can't do anything with > - document how your plugin is designed, how to use it, how it will and won't > work > > 5) Line 20 > > alert("postlink plugin: Link does not contain a valid href (must contain a > ?)"); > > See 4) > > - Richard