开发者

What's the benefit of Javascript Resources in Eclipse?

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.开发者_Go百科ajax(...)) and it also doesn't recognize $ shortcut.

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜