简体   繁体   English

我需要在 eclipse 中使用 $.getJSON 吗? 如果 jar 在 lib 中,如何声明 jquery 的导入语句?

[英]I need to use $.getJSON in eclipse? how do I declare the import statement for jquery if .jar is in lib?

need to get data, JSON data and other data from url.需要从url中获取数据,JSON数据等数据。 I need to call the function $.getJSON but it is undefined in my JSP because I need to have the proper import statement in the begining of the document, something like我需要调用 function $.getJSON 但它在我的 JSP 中未定义,因为我需要在文档开头有正确的导入语句,例如

<script type="text/javascript" src = "lib/jquery/1.11.0.min.js">

The issue is that is not my jar file name.问题不是我的 jar 文件名。 how do I link the src to the proper jar lib.如何将 src 链接到正确的 jar 库。

jar title location in lib jar 标题在 lib 中的位置

see example看例子

need to get data, JSON data and other data from url.需要从url中获取数据,JSON数据等数据。 I need to call the function $.getJSON but it is undefined in my JSP because I need to have the proper import statement in the begining of the document, something like我需要调用 function $.getJSON 但它在我的 JSP 中未定义,因为我需要在文档开头有正确的导入语句,例如

<script type="text/javascript" src = "lib/jquery/1.11.0.min.js">

The issue is that is not my jar file name.问题不是我的 jar 文件名。 how do I link the src to the proper jar lib.如何将 src 链接到正确的 jar 库。

jar title location in lib jar 标题在 lib 中的位置

404 error for jquery.ui and 1.11 min js jquery.ui 和 1.11 分钟 js 的 404 错误

Answering my own question (which is a fact).回答我自己的问题(这是事实)。 All jar files located in lib needs to be added to the build path, then you can access it through an import and leverage whatever api jar you have.位于 lib 中的所有 jar 文件都需要添加到构建路径中,然后您可以通过导入访问它并利用您拥有的任何 api jar。 This was for an eclipse jsp java project.这是针对 eclipse jsp java 项目的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM