title: Refresh XML feed on click (jQTouch)
body: <p>I recently created an xml feed -> html javascript function for an iPhone app I'm developing in jQTouch. <a href="http://net.tutsplus.com/tutorials/javascript-ajax/use-jquery-to-retrieve-data-from-an-xml-file/" rel="nofollow">Original</a> Tutorial &amp; Code.</p>
  
  <p>I was wondering if someone would know a quick and easy way to refresh the xml data (grab the feed again) when a link is clicked.</p>
  
  <p>eg. 
  <strong>in the code:</strong></p>
  
  <pre><code>&lt;div id="btns"&gt;
   &lt;ul&gt;
    &lt;li&gt;&lt;a href="#feed"&gt;Go to feed&lt;/a&gt;&lt;/li&gt; &lt;!-- When i click this, I want the getDataFeed function to dump the data &amp; rerun. --&gt;
  &lt;/div&gt;
  &lt;div id="feed"&gt;
   &lt;div id="content_from_feed_inserted_here"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>in the javascript:</strong></p>
  
  <pre><code>$(document).ready(function() {
  
  function getDataFeed() {
  
      $('.loadingPic').show(); // show progress bar
  
      $.get('http://xxxxxxx.com/information.xml', function(d) {
  
      $(d).find('location').each(function(){
  
          var $location = $(this); 
          var the_data = $location.find('xml_data').text();
  
          var collected_data = collected_data += '&lt;span&gt;' + the_data + '&lt;/span&gt;' ;
          $('#content_from_feed_inserted_here').empty().append($(collected_data)); // empty div first
  
          $('.loadingPic').fadeOut(1400); // remove progress bar
      });
  
  }
  
  // run on page load
  getDataFeed();
  
  // how do i also get it running when i click &lt;li&gt;&lt;a href="#feed"&gt;Go to feed&lt;/a&gt;&lt;/li&gt;
  
  });
  </code></pre>
  
  <p>Many thanks in advance for your help! </p>