简体   繁体   English

JQuery Javascript的自动补全在Eclipse IDE的JSP中不起作用

[英]Autocompletion for JQuery Javascript not working in JSP's in Eclipse IDE

I have a JSP Page and would like to have autocomplition in my Eclipse Editor. 我有一个JSP页面,并且希望在Eclipse编辑器中具有自动补全功能。 But it doesn't work. 但这是行不通的。

  • I have installed the JSDT Plugin for jQuery 我已经安装了jQuery的JSDT插件

在此处输入图片说明

  • I have added the js as a Library 我已将js添加为库

在此处输入图片说明

I am referencing the javascript in my JSP-Page: 我在我的JSP页面中引用了javascript:

<script type="text/javascript" src="http://localhost:8080/context/js/jquery-1.12.0.js"></script>

But I don't have autocomplition when coding: 但是我在编码时没有自动补全功能:

<script type="text/javascript">
    window.onload = function() {
    $( document ).ready(function() {



        $( "a" ).<HERE I PRESS CTRL-SPACE, BUT NOTHINGN HAPPENS>
    });
};
</script>

Any help ? 有什么帮助吗?

Disclaimer, I'm the author of tern.java 免责声明,我是tern.java的作者

I suggest you that you install tern.java which gives you a support for jQuery and if you need advanced completion like selector completion, validation, hyperlink you can activate the advanced support for jQuery . 我建议您安装tern.java ,它为jQuery提供支持 ,如果您需要高级完成功能(如选择器完成,验证和超链接),则可以激活对jQuery的高级支持

It works too with HTML/JSP. 它也适用于HTML / JSP。 Here a screenshot with your JSP sample: 这是您的JSP示例的屏幕截图:

在此处输入图片说明

After you install JSDT jQuery and add jQuery library, in the same window, you have to set Source, like below 在安装JSDT jQuery并添加jQuery库后,在同一窗口中,必须设置Source,如下所示

添加* .js * .html

Then it does work in your js and html files, good luck! 然后,它可以在您的js和html文件中运行,祝您好运!

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

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