title: How can I open a new window using a URL that is generated inside the getScript callback function, and avoid pop-up blockers?
body: <p>The issue I am having is when I try to do something like the below code, the window will be blocked by pop-up blockers. I am using getScript so that I can make cross domain requests. I am using jQuery 1.4.2 to do the below.</p>
  
  <p><strong>Example of code that will be blocked:</strong></p>
  
  <pre><code>//Code that gets blocked by pop-up blockers
  $(document).ready(function(){
      $(".popup").click(function(){
          $.getScript("URL_To_A_Javascript_File", function(){
              window.open("dynamicURL", "_blank");
          });
      });
  });
  </code></pre>
  
  <p><strong>Example of code that gets past blockers, but doesnt get URL in time:</strong></p>
  
  <pre><code>//This code will get past the pop-up blocker, but the var url won't be updated 
  //with the dynamicURL before the window.open() fires in browsers 
  //like safari or chrome.
  $(document).ready(function(){
      var url;
      $(".popup").click(function(){
          $.getScript("URL_To_A_Javascript_File", function(){
              url = "dynamicURL";
          });
          window.open(url, "_blank");
      });
  });
  </code></pre>
  
  <p>How can I open a new window using a URL that is generated inside the getScript callback function, and avoid pop-up blockers?</p>