What are the benefits of Javascript resources in Eclipse?

When I create a Dynamic Web Project in Eclipse, it generates JavaScript Resources meta-folder; before I tried to use it for the first time, I thought it worked like Java Resources - if you add your source, here the IDE provides you with Intellisense, documentation and error checking.

But when I tried to add jquery.js, I did not find anything that I expected to see. Yes, eclipse shows me that it knows the jQuery object now, but it does not know anything about jQuery methods (e.g. jQuery.ajax(...)), and also does not recognize the $shortcut.

How can I use eclipse recognition methods for js libraries that I include?

+5
source share
1 answer

Two things are not connected the way you think. JavaScript node resources indicate all known global and named "types", as well as their properties, organized according to how you set up your JavaScript Include Path project. It represents everything that JavaScript (stand-alone and client-side) is known in your project - this is what Content Assist can offer you, shown in what we hope is a well-laid out and viewable structure.

What you came across is that jQuery is more dynamic and maybe a little more syntactically more complex than JSDT understands. Googling for jQuery and JSDT should help you find a plug-in that helps in this regard.

+4
source

All Articles