Applet calls JavaScript function

xiaoxiao2021-03-06  119

Using the JavaScript program call method in the applet is as follows: 1 First introduced JSObject package // LiveConnect ... for javascriptimport netscape.javascript.jsObject; 2 In calling JS: try {// creation JSObjectJsObject. getWindow (this). Eval () ") ()")} Catch (Exception EX) {Error Tip} Note that this this is an applet object, you can give you JS transfer parameters jsObject.getWindow (this) . Eval ("JavaScript :: WINDOW.OPEN (/" http: // localhost: 8080 / new.jsp? id = " ID " / ")")} There are many flexible methods to pay special attention to the following three points: Second, the attention to the place (1) When calling the JavaScipt function, add this line: jsobject.getWindow (this). Eval ("JavaScript: ..."); (2) To bring JSObject reference: import netscape. JavaScript.jsobject; (3) Defining the applet When you add "MayScript" tag Using this feature in a small applet,

转载请注明原文地址:https://www.9cbs.com/read-100169.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.046, SQL: 9