title: jQuery: can't alter externally loaded content
body: <p><b>ISSUE:</b> We are building a website on a very restricted CMS. We need to replace a certain function in anchor's href. Unfortunately, the content loaded is external and this piece of code does not work:</p>
  
  <p>jQuery:</p>
  
  <pre><code>$(document).ready(function() {
      $('a[href*="show_upsell_dialog"]').each(function(e){
              $(this).attr('href', $(this).attr('href').replace('show_upsell_dialog(', 'more_details_1('));
      });   
  });
  </code></pre>
  
  <p>HTML bit:</p>
  
  <pre><code>&lt;a href="javascript:show_upsell_dialog(1238)"&gt;Details&lt;/a&gt;
  </code></pre>
  
  <p><b>QUESTION:</b> Why? How do i make it work?</p>