title: Load JQuery before custom cross-site Script is loaded?
body: <p>I want to load a custom script on a page from a different domain. I do it as: </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  (function(d){
    var f = d.getElementsByTagName('SCRIPT')[0], p = d.createElement('SCRIPT');
    p.type = 'text/javascript';
    p.async = true;
    p.src = '//domainA.com/js/custom.js';
    f.parentNode.insertBefore(p, f);
  }(document));
  &lt;/script&gt;
  </code></pre>
  
  <p>My custom.js script uses JQuery as well as Ajax to load additional content. </p>
  
  <p>How do I check if jquery is on the page and load it before the script custom.js is excecuted? </p>
  
  <p>How can I ensure that cross-site ajax requests work in the custom.js script?</p>