(JSP) display hyperlinks in text fields-JavaScript Section

Source: Internet
Author: User

After the applet is complete, you need to start writing JavaScript. Because Javascript is also interpreted by the browser, it can easily interact with the applet.

 

// @ Author zenny Chen

// First loaded JavaScript function for communication with the specified Applet
Function accessapplet ()
...{
If(window.doc ument. testapplet! = NULL )...{
VaR IP = Window. Location. href;
Window.doc ument. testapplet. setsocketurl (IP );
Optional values Doc ument. testapplet. setmayrun (true );
SetTimeout ("loopprocessapplet ()", 1000 );
}
}


Function loopprocessapplet ()
...{
Processapplet ();
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 ();
}
}


// First loaded JavaScript function for communication with the two specified applets
Function accessappletdual ()
...{
VaR IP = Window. Location. href;
If(window.doc ument. testapplet! = NULL )...{
Window.doc ument. testapplet. setsocketurl (IP );
Optional values Doc ument. testapplet. setmayrun (true );
}
If(registry.doc ument. testapplet2! = NULL )...{
Window.doc ument. testapplet2.setsocketurl (IP );

If(registry.doc ument. testapplet = NULL)
Optional values Doc ument. testapplet2.setmayrun (true );
}
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 )...{
If (! Invalid parameter Doc ument. testapplet2.getisover ())...{
If(registry.doc ument. testapplet = NULL)
Optional values Doc ument. testapplet2.setmayrun (true );
Else
Registry.document.testapplet2.setmayrun(registry.doc ument. testapplet. getisover ());
}
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 ();
}
}
}

The preceding Code consists of two parts: accessapplet (), loopprocessapplet (), and processapplet (), which are used to control an applet in a web. What follows dual is that a page contains two such applets which need to be controlled by JavaScript.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.