how do I change the load sequence of external javascript
<p>I have a web page that loads an external chat script, but the script loads before all my CSS and jQuery kick in, so my page looks all messed up for a few seconds.  Need help figuring out how to launch my chat script once the page is done loading...I think it can be done by adding the script into my jQuery setup, but I'm not sure how to do that.</p>

<p>here's the code, it's self-explanatory enough not to be familiar with the actual software.</p>

<pre><code>&lt;script&gt;
var online_text = "Chat Online Now";
var offline_text = "Chat Not Available";
var check_back = 1; // this lets the script check the operator status without being logged in
&lt;/script&gt;
&lt;script src="http://my.domain/chat/file.php"&gt;&lt;/script&gt;
</code></pre>

<p>I think what happens is that the .php file will write my online or offline text with the necessary chat link, and that's why I have to put the script in the place where I want the chat text to display. </p>

<p>hope that makes sense...and hopefully the community can help me figure out how to solve the problem. thanks!</p>

<p>UPDATE: here's where I am so far, unfortunately the #chaticon element is empty, even if I replace the script with simple text. Using jQuery 1.4.2 by the way:</p>

<pre><code>$(document).load(function() { 
var online_text = 'Chat Online Now'; 
var offline_text = 'Chat Not Available'; 
var check_back = '1'; 
$("li#chaticon").html('&lt;script type="text\/javascript" src="http:\/\/my.domain\/chat\/file.php"&gt;&lt;\/script&gt;');
});
</code></pre>
