title: Accessing JS array data from an external JS file
body: <p>I have a PHP script that generates a Javascript array and uses JSON to insert into this array into body of my web page.</p>
  
  <p>Is it possible I can then access this array data with a Javascript file?</p>
  
  <p>So, say the code on my page is:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt; var park_data = [{"title":"Football Park"},"title":"Rugby Park"}]&lt;/script&gt; 
  </code></pre>
  
  <p>&amp; I have </p>
  
  <pre><code>&lt;script type="text/javascript" src="script.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>how do I access <code>park_data</code> using <code>script.js</code>?</p>
  
  <hr>
  
  <p><strong>edit</strong></p>
  
  <p>Ultimately, I'd like to have this in my <code>script.js</code> so the titles are shown in an infoWindow bubble:</p>
  
  <blockquote>
    <p>var infowindow = new google.maps.InfoWindow({
                content: park_data["title"]
            });</p>
  </blockquote>
  
  <p>However, right now it's not displaying the title :(</p>
  
  <hr>
  
  <p>Thank you</p>