Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse: dynamic web project, where to put my download jQuery API

I have created my dynamic web project in Eclipse. Since my UI use javascript jQuery, I have download the jQuery API, I am wondering where to put it in my eclipse project?. Under which directory? is there any configurations for the jQuery API inside eclipse?

like image 542
Mellon Avatar asked Apr 07 '11 08:04

Mellon


People also ask

Where do I put JavaScript in dynamic Web project in Eclipse?

JavaScript . js files are placed under the js sub-folder and any image files such as . jpeg or . png are placed in the images sub-folder.


3 Answers

I'm not quite sure if you just want to know how to provide jQuery for your WebApplication or if you want to be able to develop JavaScript applications with jQuery and have autocompletion for doing so.

To use jQuery in your WebApp you can put it somewhere in the WebContent folder. I usually create a "scripts"-folder where I have all the js files.

You can then link from your servlet / html file... or whatever to the js file. E.g. you have an index.html in the WebContent directory then you would use the path scripts/jquery.js to link to the js file in the scripts folder.

I hope this was some help to you.

br, Chris

like image 125
csupnig Avatar answered Oct 03 '22 04:10

csupnig


It's up to you where you put it. Once you decide on somewhere include jQuery with script tags on which ever pages you want it. For example:

<script type="text/javascript" src="/path/to/jquery/jquery-1.4.4.min.js"></script>

Obviously the name and version of your jquery .js might be different so update where necessary.

like image 26
elbekay Avatar answered Oct 03 '22 05:10

elbekay


create a new folder in your existing project as example script and place jquery.js file.

To include the file in programming just give the path as:

<script type="text/javascript" src="/script/jquery/jquery-1.4.4.min.js"></script>
like image 29
user2787470 Avatar answered Oct 03 '22 05:10

user2787470