举一个例子吧:
1
<!
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
>
2 < html >
3 < head >
4 < title > Untitled Document </ title >
5 < meta http-equiv ="Content-Type" content ="text/html; charset=gb2312" >
6 < APPLET id ="AgentPannel" style ="HEIGHT: 0px,WIDTH:0px,display:none" height ="0" width ="0" code ="com.micki.Test" archive ="test.jar" name ="Test" >
7 </ APPLET >
8 </ head >
9 < body onload ="LoadAll()" >
10 </ body >
11 </ html >
2 < html >
3 < head >
4 < title > Untitled Document </ title >
5 < meta http-equiv ="Content-Type" content ="text/html; charset=gb2312" >
6 < APPLET id ="AgentPannel" style ="HEIGHT: 0px,WIDTH:0px,display:none" height ="0" width ="0" code ="com.micki.Test" archive ="test.jar" name ="Test" >
7 </ APPLET >
8 </ head >
9 < body onload ="LoadAll()" >
10 </ body >
11 </ html >
注意:Applet类被打包成了jar包,需增加archive配置项(否则不需要,直接在code配置项里填写完整的Applet类名,后要加.class),类名为com.micki.Test.class,code配置项应为“com.micki.Test” ,后不要带.class,
name配置项可以看作是对Applet的引用,在后面代码中即可使用JS对Test直接引用。