Check if external javascript file is loaded

ive heard that there is a way to check if an external javascript file has loaded such as in the following example:

<script language='javascript' src="file.js"></script>

what i want to know is if there is a way to tell when this file.js has loaded?
on the Microsoft network is says that this is possible (, however i do not know how to implement it.

if you put an onload in the JS it will trigger when the external JS has loaded.
onload=alert(“js loaded”)

To make an external onload trigger when the document has loaded use
window.onload=function () {alert(“doc loaded”)}

You could also check to see if a variable that is unique to the external javascript is available. If you had the variable “x” in the external script then after the include for the exteranl script you could do this:
if(window.x) // is available
{then do something}
else // not available
{do something else}