title: jQuery: Pass plugin a string reference to be used as object in plugin
body: <p>This may be a little non-standard.....</p>
  
  <pre><code>// JavaScript Document
  (function( $ ){
  $.fn.editAsPage = function(options) {       
      var settings =  {};     
      if(options){ jQuery.extend(settings, options); }        
      return this.each( function(){           
          var el = jQuery(this);
          alert(settings.source.attr("class"));                         
      });
  };
  })(jQuery);
  </code></pre>
  
  <p>My question lies around the settings.source parameter. attr("class") is just an example, there are several attributes I need to get from a particular DOM element, but the user of the plugin may need to define which DOM element settings.source is.</p>
  
  <p>So you say, just pass in an jQuery object.  Where I run into a problem is that I, for one, want to reference the parent of "this" in the plugin.</p>
  
  <p>For example:</p>
  
  <pre><code>jQuery(".edit").editAsPage({
          'source':jQuery(this)                                                              
      });
  </code></pre>
  
  <p>Here, jQuery(this) won't refer to element with the .edit class since it will interpret it before calling the editAsPage function.</p>
  
  <p>I guess the question is, can I pass a string to the editAsPage function to be interpreted as a jQuery object in the plugin?</p>
  
  <p>This is a very simple example.  The reason, I don't just use "this" inside the plugin, is because "source" could change.  It may very well be something like:</p>
  
  <p>'source':jQuery(this).parents("selector:first")</p>
  
  <p>Not sure if that made any sense what I'm asking.  It makes sense in my mind. :)</p>
  
  <p>Thanks.</p>