Hello,
I copied this page from a device running embeded linux and I want to put it on a different computer on the same network to control this device. My javascript knowledge is bellow zero. The page is looking for local files. I understand that I have to point all the commands to my embeded linux device (url= [url]
Thank you.
This is the page:
<HTML>
<HEAD><TITLE>Matrix3 LX-300 Control Page</TITLE></HEAD>
<BODY>
<H1>Matrix3 LX-300 Control Page</H1>
This is the default web page provided by the LX-ELC EtherTracks module.
<p>
To modify this page, use your web browser to save this page as “index.html” on your local computer, edit it as desired, and then import the modified file back into your project by selecting “Import Files…” from the Files menu in the “Support Files” window (or by dragging the index.html file’s icon into that window).
<p>
For more information, call Meyer Sound at (626) 836-0446, or visit <a href=”
<p>
<p>
<p>
<script language=Javascript>
var req;
// This function requests the specified URL in the background, then
// opens up a little window when the URL has been downloaded.
function OpenURLInBackground(url)
{
req = false;
if (window.XMLHttpRequest)
{
// branch for native XMLHttpRequest object
try {
req = new XMLHttpRequest();
} catch(e) {
req = false;
}
} else if(window.ActiveXObject) {
// branch for IE/Windows ActiveX version
try {
req = new ActiveXObject(“Msxml2.XMLHTTP”);
} catch(e) {
try {
req = new ActiveXObject(“Microsoft.XMLHTTP”);
} catch(e) {
req = false;
}
}
}
if (req)
{
try {
req.onreadystatechange = ProcessStateChange;
req.open(“POST”, “http://192.168..10.101”, true);
req.send(“”);
} catch(e) {
alert(“Error sending asynchronous URL request”);
}
}
else alert(“Unable to create asynchronous URL request — perhaps your web browser doesn’t support XMLHttpRequest objects”);
}
var popup;
function ProcessStateChange()
{
if (req.readyState == 4) // only if req shows “loaded”
{
if (req.status == 200)
{
// If request succeeded, show a little temporary window to notify user
popup = window.open(“”, “popup”, “dependent=yes,width=200,height=25”);
popup.document.write(“<HTML><head><title>Command sent!</title></head><BODY>The command was sent!</BODY></HTML>”);
setTimeout(“popup.close()”, 1000);
}
else
{
// Otherwise, tell user about the problem
alert(“There was a problem sending the command:n” + req.statusText);
}
}
}
// This function tells the system to recall the cue with the specified ID.
function RecallCue(cueID)
{
lsb = ((cueID%128).toString(16)); // low 7 bits of the cue ID
hsb = ((cueID>>7).toString(16)); // high 7 bits of the cue ID
OpenURLInBackground(‘
}
// This function opens a dialog showing the system’s current Log contents.
// The contents will be re-downloaded every 10 seconds.
function ShowLog()
{
// Generate the proper Log URL (e.g. “
// current document URL (e.g. “
url = location.href;
slashslash = url.indexOf(“//”);
if (slashslash >= 0)
{
nextSlash = url.substring(slashslash+2).indexOf(“/”);
if (nextSlash >= 0) url = url.substring(0, nextSlash+slashslash+2);
url = url + “:8000”;
}
logpopup = window.open(“http://192.168.10.201:8000″,”log”,”dependent=yes,width=850,height=500″);
setInterval(“logpopup.location.reload()”, 10000) // have the log refresh itself every 10 seconds
}
// This function opens a dialog showing the system’s current status.
// The contents will be updated every 10 seconds.
function ShowStatus()
{
statpopup = window.open(“
setInterval(“statpopup.location.reload()”, 10000) // have the window refresh itself every 10 seconds
}
</SCRIPT>
<P>
<hr>
<h2><i>Recall Cues:</i></h2>
<p>
<form>
<input type=”button” onclick=”RecallCue(0)” value=”Cue 0″/>
<input type=”button” onclick=”RecallCue(1)” value=”Cue 1″/>
<input type=”button” onclick=”RecallCue(2)” value=”Cue 2″/>
<input type=”button” onclick=”RecallCue(3)” value=”Cue 3″/>
<input type=”button” onclick=”RecallCue(4)” value=”Cue 4″/>
<p>
<input type=”button” onclick=”RecallCue(5)” value=”Cue 5″/>
<input type=”button” onclick=”RecallCue(6)” value=”Cue 6″/>
<input type=”button” onclick=”RecallCue(7)” value=”Cue 7″/>
<input type=”button” onclick=”RecallCue(8)” value=”Cue 8″/>
<input type=”button” onclick=”RecallCue(9)” value=”Cue 9″/>
</form>
<p>
<p>
<hr>
<h2><i>Maintenance:</i><p></h2>
<A HREF=”javascript: ShowStatus()”>Show Current Status</A><p>
<A HREF=”javascript: ShowLog()”>Show Current Log</A><p>
</BODY>
</HTML>