Reference a local file instead of a remote file
<p>I have some code that downloads a file from the internet located here:</p>

<p><a href="http://www.amsat.org/amsat/ftp/keps/current/nasa.all" rel="nofollow">http://www.amsat.org/amsat/ftp/keps/current/nasa.all</a></p>

<p>and performs certain calculations on it in order to determine a satellites location. Because of server issues which seem to prevent this file from being downloaded I want to move this file onto the local machine and reference it from there. </p>

<p>I know that javascript can't read .txt files without an ActiveX component involved but if I change the variable URL to reference the file would it work in the same way? I tried saving the file as a .txt, .all and a .xml file and the program fails. What am I doing wrong? </p>

<p>The code for getting the original file is below and the URL it looks to is above.</p>

<pre><code>function getOrbitalElements()
{
TLE_Line1="";
TLE_Line2="";

pgTXT = "";

xmlhttp = null;

if ( window.XMLHttpRequest )
{
    xmlhttp = new XMLHttpRequest();
} 
else if ( window.ActiveXObject )
{
    xmlhttp = new ActiveXObject( "Microsoft.XMLHTTP" );
}

if( xmlhttp != null )
{ 
    xmlhttp.onreadystatechange = stateChange;
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
}
}
</code></pre>

<p>Finally I moved the file to the same folder as the html file and removed any spaces in the file name to see if it makes a difference. Nothing seems to work - anyone got any ideas?</p>
