title: GWT library with external Javascript script
body: <p>I wrote an GWT library for a javascript visualization library (<a href="http://dygraphs.com/" rel="nofollow">dygraphs</a>).<br>
  It's a simple wrapper using <code>JavascriptObject</code> and <code>JSNI</code> to call into the dygraphs code.<br>
  So far I have included the <code>dygraphs.js</code> script in my GWT's module xml file and it worked just 
  fine. </p>
  
  <p>However when I recently tried to use <code>SuperDevMode</code> I had to switch to the <code>xsiframe linker</code> which doesn't allow script tags.<br>
  What is the best practice for including external javascript scripts in a GWT library with the cross site linker?</p>
  
  <p>The best thing I could come up with was to include the Javascript file as a <code>TextResource</code> in a <code>ClientBundle</code> and then use <a href="http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/core/client/ScriptInjector.html" rel="nofollow">ScriptInjector</a> to include it?  </p>
  
  <p>Is that the recommended approach or is there any better way? </p>
  
  <p>I have to make sure that the dygraphs.js is fully loaded before my app that is using my GWT wrapper is going to access it. </p>