目錄結(jié)構(gòu):jsp導(dǎo)入jquery文件,老是不起作用,原因在于:
復(fù)制代碼 代碼如下:
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
復(fù)制代碼 代碼如下:
<%@ page language="java" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="java.util.*" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"http://www.companysz.com/";
%>
<html>
<head>
<base href="<%=basePath%>" />
<link rel=stylesheet type="text/css" href="css/style.css"/>
<script type="text/javascript" src="js/jquery-1.5.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
alert("hello, jquery");
});
</script>
<title>登錄</title>
</head>
<body>
<p><%=basePath%></p>
</body>
</html>
新聞熱點(diǎn)
疑難解答
圖片精選