【发布时间】:2014-02-08 04:58:09
【问题描述】:
这是我在 WEB-INF/jsp 文件夹下的文件:
<%@ 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">
<title>jQuery Hello World</title>
<script type="text/javascript" src="/WEB-INF/static/jquery-1.4.2.js"></script>
</head>
<script type="text/javascript">
$(document).ready(function(){
$("#flag").html("Hello World !! I have come from J Query World");
});
</script>
<body>
<font color="RED"> Hello World !! I have come from plain world</font>
<font color="BLUE"> <div id="flag"></div></font>
</body>
</html>
我的 jquery 文件在 WEB-INF/static 下 我应该怎么做才能使我的代码正常工作,我认为 .js 文件的路径导致了问题。
【问题讨论】:
-
您在自己喜欢的浏览器的开发者控制台中看到了哪些(如果有)错误消息?
-
您为什么要使用 jQuery 1.4.2 编写新代码?它在 jQuery 方面是古老的。就此而言,您为什么在本世纪使用 ISO-8859-1?还是
<font>元素? -
您的 HTML 无效,请使用 validator。
标签: javascript jquery jsp