title: cross-domain GET
body: <p>Someone was nice to write me a script that allows to retrieve data from cross domain site. The PHP looks like this:</p>
  
  <pre><code>&lt;?php
  if(isset($_GET['site'])){
    $f = fopen($_GET['site'], 'r');
    $html = '';
    while(strpos($html, 'position1_article_1') === FALSE)
      $html .= fread($f, 24000);
    fclose($f);
    echo $html;
  }
  ?&gt;
  </code></pre>
  
  <p>Which is saved as <strong>proxy.php</strong> The Jquery part looks like this:</p>
  
  <pre><code>$(function(){
  
     var site = 'http://www.nu.nl';
  
     $.get('proxy.php', { site:site }, function(data){
  
        var href = $(data).find('.hdtitle').first().children(':first-child').prop('href');
        var url = href.split('/');
        href = href.replace(url[2], 'nu.nl');
  
        // Put the 'href' inside your div as a link
        $('#myDiv').html('&lt;a href="' + href + '" target="_blank"&gt;' + href + '&lt;/a&gt;');
  
     }, 'html');
  
  });
  </code></pre>
  
  <p>The problem is that I cant figure out how to get all the 'a' in the body or certain part like h2, h3 etc. Can someone please break it down to me? For instance; what do I have to change in order to get all the href in the page?</p>