分類  >  WEB開發 >

servlet里調用js和vbs腳本的有關問題!

tags:    時間:2013-12-09 22:58:14
servlet里調用js和vbs腳本的問題!---在線等...
servlet源文件:

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Myfirst extends HttpServlet{
  protected void service(HttpServletRequest request,HttpServletResponse response)throws
ServletException,IOException{
response.setContentType("text/html");
PrintWriter out=response.getWriter();
/*servlet里調用css的語法格式:
  out.println("<head><link rel='Stylesheet' href='pro/css.css' type='text/css'></head>");
  */
out.println("<head>");
out.println("<meta http-equiv='Content-Type' content='text/html;Charset=gb2312' />");
out.println("<title>Welcome to Fendou Studio</title>");
out.println("<script language='vbscript' src='pro/link.vbs'></script>");
out.println("</head>");
out.println("<body bgcolor=''>");
out.println("<table width=100% height=500 border=0>");
out.println("<tr align=center>");
out.println("<td valign=middle>");
out.println("<img src=img/fendoupage.gif>");
out.println("</td>");
out.println("<td valign=bottom>");
out.println("<a href=jspFiles/index.jsp>");
  out.println("<img id=image1 style='FILTER: revealTrans(Duration=4.0, Transition=25);VISIBILITY: hidden' src=img/button.jpg border=0>"); 
  out.println("</a></td></tr></table>");
  out.println("</body>");
  }
}
vbs腳本內容:
<SCRIPT FOR=window EVENT=onLoad LANGUAGE=vbscript>
image1.filters.item(0).apply()
image1.filters.item(0).transition = 12
image1.Style.visibility = ""
image1.filters(0).play(5.0)
</SCRIPT>
html中引入vbs腳本的例子:
<html>
<head>
<meta http-equiv="Content-Type" content='text/html;charset=gb2312' />
<title>奮鬥工作室-圖片漸顯效果</title>
<SCRIPT FOR=window EVENT=onLoad LANGUAGE=vbscript>
image1.filters.item(0).apply()
image1.filters.item(0).transition = 12
image1.Style.visibility = ""
image1.filters(0).play(5.0)
</SCRIPT>
</head>
<body bgcolor="" >
<table width=100% height=500 border=0>  
<tr align=center>
<td valign=middle>
<img src=img/fendouPage.gif>
</td>
<td valign=bottom>
<a href=jspFiles/index.jsp>
<img id=image1 style='FILTER: revealTrans(Duration=4.0, Transition=25); VISIBILITY: hidden' src=img/button.jpg border=0>
</a>
</td>
</tr>
</table>
</body>
</html>
圖片地址:
http://tdy218.googlepages.com/fendoupage.gif
http://tdy218.googlepages.com/button.jpg



------解決方案--------------------
link.vbs里不要<Script>標記
'link.vbs
Sub window_onLoad()
image1.filters.item(0).apply() 
image1.filters.item(0).transition = 12 
image1.Style.visibility = "" 
image1.filters(0).play(5.0) 
End Sub

推薦閱讀文章

Bookmark the permalink ,來源:互聯網