<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>My JSP ‘MyJsp.jsp‘ starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> </head> <%--推断浏览器是否支持javascript脚本语言 不支持就显示noscript标签中的div内容 --%> <noscript>您的浏览器不支持javascript,部分功能无法使用,请又一次安装浏览器!</noscript> <body> <%--这是应该正常显示的内容 --%> <div class="aboutus" id="js_support" style="display: none;"> aboutus</div> </body> <%--这是在浏览器支持javascript脚本语言的时候。操作的js代码 --%> <script type="text/javascript"> document.getElementById("js_support").style.display = "block"; </script> </html>
时间: 2024-09-30 11:44:00