 <p>You do not pass parameters to scripts, you pass parameters to functions.</p> <p>You will need to change your script so that it doesn't actually do anything until the functions therein are <em>invoked</em>, and pass the parameters at that point.</p> <p>Your problem then becomes just one of figuring out when the script has completed loading, which can be done by adding a <code>.onload</code> handler to the <code>&lt;script&gt;</code> element object.</p>