亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

JSP里執行js的window.onload()方法異常

JSP里執行js的window.onload()方法異常

阿波羅的戰車 2018-09-21 10:10:09
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"    pageEncoding="ISO-8859-1"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><% String cp = request.getContextPath();%>  <title>Insert title here</title><script>function fun(){        window.location.href="<%=cp %>/OnloadServlet";}function test(){    <%System.out.println("test");%>}function test1(){    <%System.out.println("test1");%>}</script></head><body onload="fun()">    </body></html> 異常:每次load頁面時  test(),test1()的方法就會執行,請問是為什么呢?
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 987 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號