Since Javascript is not required to strictly control the running of the applet, the code is much simpler than previously:
// Appletaccess. js
// @ Author zenny Chen
Function accessapplet ()
...{
If(window.doc ument. testapplet! = NULL )...{
VaR IP = Window. Location. href;
Window.doc ument. testapplet. setsocketurl (IP );
SetTimeout ("loopprocessapplet ()", 1000 );
}
}
Function processapplet ()
...{
If(registry.doc ument. testapplet = NULL)
Return;
VaR STR = Invalid Response Doc ument. testapplet. geturlname ();
If (STR! = "")...{
Zookeeper Doc ument. testapplet. clearurlname ();
VaR win = Window. Open (STR, "", "Height = 300, Top = 100, Left = 100, toolbar = No, menubar = No, status = No ");
Win. Close ();
}
}
Function loopprocessapplet ()
...{
Processapplet ();
SetTimeout ("loopprocessapplet ()", 1000 );
}
Function accessappletdual ()
...{
VaR IP = Window. Location. href;
If(window.doc ument. testapplet! = NULL )...{
Window.doc ument. testapplet. setsocketurl (IP );
}
If(registry.doc ument. testapplet2! = NULL )...{
Window.doc ument. testapplet2.setsocketurl (IP );
}
If(window.doc ument. testapplet = NULL & window.doc ument. testapplet2 = NULL)
Return;
SetTimeout ("loopprocessappletdual ()", 1000 );
}
Function loopprocessappletdual ()
...{
Processappletdual ();
SetTimeout ("loopprocessappletdual ()", 1000 );
}
Function processappletdual ()
...{
If(window.doc ument. testapplet! = NULL )...{
VaR STR = Invalid Response Doc ument. testapplet. geturlname ();
If (STR! = "")...{
Zookeeper Doc ument. testapplet. clearurlname ();
VaR win = Window. Open (STR, "", "Height = 300, Top = 100, Left = 100, toolbar = No, menubar = No, status = No ");
Win. Close ();
}
}
If(registry.doc ument. testapplet2! = NULL )...{
VaR STR = Invalid Response Doc ument. testapplet2.geturlname ();
If (STR! = "")...{
Zookeeper Doc ument. testapplet2.clearurlname ();
VaR win = Window. Open (STR, "", "Height = 300, Top = 100, Left = 100, toolbar = No, menubar = No, status = No ");
Win. Close ();
}
}
}