title: Warning: A call to document.write() from an asynchronously-loaded external script was ignored. How is this fixed?
body: <p>In my Ruby on Rails application I am using the <a href="http://defunkt.io/facebox/" rel="nofollow noreferrer">Facebox plugin</a> for an Ajax pop up window. I have 2 pages called <code>add_retail_stores/new.html.erb</code> and <code>add_retail_stores/new.js</code>. The <code>new.js</code> page inherits all elements from the <code>new.html.erb</code> page so it looks exactly alike. I have a Google map script on the HTML page that works as it should. But the <code>new.js</code> page that pops up on my different page called <code>add_store_prices.html.erb</code> page(<code>&lt;%= link_to add_retail_store_path, :remote =&gt; true %&gt;</code>) </p>
  
  <p>I get the error:</p>
  
  <blockquote>
    <p>Warning: A call to document.write() from an asynchronously-loaded external script was ignored.
    Source File: <a href="http://localhost:3000/add_store_prices" rel="nofollow noreferrer">http://localhost:3000/add_store_prices</a>
    Line: 0</p>
  </blockquote>
  
  <p>I believe because it's trying to go through 2 functions/scripts. The first one for the Facebox and then the Google script. Anyone know how to handle this error?</p>
  
  <h2>EDIT:</h2>
  
  <p>I believe the Facebox plugin is using <code>document.write</code> but I am not sure where, perhaps in one of these 2 lines on my page?</p>
  
  <p><strong>new.js:</strong></p>
  
  <pre><code>$.facebox('&lt;%= escape_javascript(render :template =&gt; 'business_retail_stores/new.html') %&gt;')
  $('#facebox form').data('remote','true');
  </code></pre>