jquery.js文件的位置 [英] location of jquery.js file
本文介绍了jquery.js文件的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了一个示例jsf应用程序,并尝试使用jquery. jquery.js文件应位于哪个目录?网络信息? src?我下载了.js文件,但似乎无法正常工作.我不确定应该在哪里.
I have created a sample jsf application, and am trying to use jquery. In what directory should the jquery.js file be located? web-inf? src? I downloaded the .js file, but it does not seem to be working. I'm not sure where it should be.
我已经更新了代码以指向googleapis,但仍然无法正常工作:
I have updated my code to point to the googleapis, but it still does not work:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js">
$(document).ready(function(){
$("#p1").mouseenter(function(){
alert("You entered p1!");
});
});
</script>
<p id="p1">Enter this paragraph.</p>
</h:body>
推荐答案
没关系,最重要的是您必须提供正确的路径.
It doesnt matter, the most important is you have to give the correct path.
例如:
<script language="javascript" src='script/jquery-1.6.min.js'></script>
并且必须将包含jquery的html文件与脚本文件夹放在一起.
And your html file which includes jquery must be put alongside with the script folder.
这篇关于jquery.js文件的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文