| text=(string) textfield.getmember("value"); //获取文本区的值 |
| …… |
| win.eval("alert(\"this alert comes from java!\")"); |
| // 调用javascript的alert()方法 |
| …… |
| “user.htm” |
| …… |
| <body> |
| <form name="textform"> |
| <p>enter text and then click display text: |
| <input type="text" name="textfield" size="20"></p> |
| </form> |
| <applet code="readform.class" width=200 height=100 name="readapp" mayscript> |
| //必须使用mayscript属性标志 |
| </applet> |
| </body> |
|
| 附表列举了jsobject类的方法和描述,更详细的说明可以参考msdn。值得一提的是,本文中程序示例加下划线的部分,要特别引起注意。 |