What is the best way to deal with server side data saved as a javascript variable
<p>What is the best way to handle global variables when they are necessary.  For example JSON that is inserted server side with PHP into the web page. <code>var data = &lt;?php getData() ?&gt;</code> </p>

<p>There seems to be 3 options.<br>
1 leave it for garbage collection<br>
2 leave off the var initialization of the variable and delete the variable<br>
3 just set the variable to null and again leave it to GC. </p>

<p>Or there may be some other way that I haven't thought of I am open to suggestions.  Though I would prefer not to use ajax in this situation.  Also, it is not feasible to insert the variable data inside of the actual javascript code because I minify it.</p>

<p>EDIT:
The reason I am asking is the data could be potentially large and I was wondering what is the best way to deal with it.  Also, I am not sure how long garbage collection takes; so maybe it is really a non-issue. I don't know?</p>
