I want to be able to access the value of a nested each() function outside of the function.
I have code below or http://jsfiddle.net/z36UK/6/
HTML:
<div id="wrap">
  <ul data-role="listview" data-filter="true" data-filter-placeholder="Search..." id="ds-canho"> 
  </ul>
</div>
Javascript:
$(document).ready(function() {
  var urlx=[];  
  parseXml();
  alert(urlx);
  console.log(urlx);
  $.mobile.loading( "show" );
  $.ajax({
    type: "GET",
    url: 'https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%27http://saigonpearl.info/home/notype/-0-trang-chu.html%27%20and%20xpath%3D%22%2F%2Fdiv%5B%40class%3D%27tindang%27%5D%22&diagnostics=true',
    dataType: "xml",
    success: parseXml
  });
  function parseXml(xml) {
    $(xml).find("div.tindang").each(function() {
      var url = $(this).find('a').attr("href"),
      urlx= url.replace('#menutop','');
      $("ul#ds-canho").append('<li>' + $(this).find('h3').text() + '</li>');
      $('ul#ds-canho').listview('refresh');
      $.mobile.loading( "hide" );
    });
  }
});
 
     
     
     
    