title: Jquery widget callback. Getting a function to fire
body: <p><strong>I added a callback to a jquery widget. It will output data in the console but how do I get it to apply something to the data in the page?</strong></p>
  
  <p>Example...</p>
  
  <p>in my widget options I have made the following available to receive input:</p>
  
  <pre><code> complete        : ''
  </code></pre>
  
  <p>and have added a method to the widget as well:</p>
  
  <pre><code>_complete : function(data) {
          if(this.options.complete) {
              console.log(data);
          }
      }
  </code></pre>
  
  <p>In another method of the widget I make an ajax call and then call use this <code>_complete</code> method to fire after the ajax has finished like:</p>
  
  <pre><code>self._complete(self.options.complete);
  </code></pre>
  
  <p>So if, when I use the widget, I pass something to the <code>complete</code> option like so:</p>
  
  <pre><code>complete : function(){$('.gridrow').css('background-color','#FFF');}
  </code></pre>
  
  <p>I will see this output in the console as:</p>
  
  <pre><code>function(){$('.gridrow').css('background-color','#FFF');}
  </code></pre>
  
  <p>But what I really want is to actually apply that to the code, so that it changes the gridrow classes background color. </p>
  
  <p><strong>I can pass in whatever and get it output in the console but how to I actually apply it to the page?</strong></p>