Possible to load data into a javascript file?
<p>I have a fly out javascript menu that is initialized using the onload event. All of the data inside the menu right now is hard coded but needs to be dynamic and will come from my database. Is there a way to build this javascript file with my database values? Is this possible? I'm a total noob to JS so please spell things out for me.</p>

<hr>

<p>Maybe an example of what I'm thinking will help. This is part of my JQuery file after I have my serialized array. How do I get the array into the menu from here? </p>

<pre><code>      if(data.success == 0) {
        // error
      } else {
        // my array that needs to be exported into the JS file.
      }
</code></pre>

<p>This is the other file that I'm talking about that needs to be built with the data from the database.</p>

<pre><code>function create_menu()
{
  document.write(
    '&lt;table cellpadding="0" cellspaceing="0" border="0" style="width:98%"&gt;&lt;tr&gt;' +
    '&lt;td class="td" valign="top"&gt;' +

    '&lt;h3&gt;Test&lt;/h3&gt;' +
    '&lt;ul&gt;' +
      '&lt;li&gt;afd&lt;/li&gt;' +
      '&lt;li&gt;fsg&lt;/li&gt;' +
      '&lt;li&gt;sfg&lt;/li&gt;' +
      '&lt;li&gt;fsg&lt;/li&gt;' +
    '&lt;/ul&gt;' +
    '&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;');
}
</code></pre>
