What's the benefit of Javascript Resources in Eclipse?

无人久伴 提交于 2021-02-08 15:25:31

问题


When I make Dynamic Web Project in Eclipse it generates Javascript Resources meta-folder; before I tried to use it at first time I thought that it works just like Java Resources - if you add your source here IDE provides you with Intellisense, documentation and error checking.

But when I tried to add jquery.js there, I found nothing that I was expecting to see. Yes, eclipse shows me that it's aware of jQuery object now but it knows nothing about jQuery's methods (like jQuery.ajax(...)) and it also doesn't recognize $ shortcut.

How can I make eclipse recognize methods of js libraries that I include?


回答1:


The two things aren't related in the way you think. The JavaScript Resources node indicates all of the known globals and named "types", as well as their properties, organized according to the way you've set up the project's JavaScript Include Path. It represents everything that is known to the JavaScript (standalone and client-side) in your project--this is what Content Assist will be able to offer you, shown in what we hope is a nicely laid out and browseable structure.

What you've run into is that jQuery is more dynamic, and perhaps a little trickier syntactically, than JSDT understands. Googling for both jQuery and JSDT should help you find a plug-in that helps in that regard.



来源:https://stackoverflow.com/questions/7429776/whats-the-benefit-of-javascript-resources-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!