Let's create another web project. It will be mapped to the same web address space. We will make the same steps as we have done for creating the first project.
Create a Plug-in project. Name it second. Uncheck Create a Java project checkbox. Uncheck Create a plug-in using one of the templates checkbox A web plug-in project have to be a singleton, so check This plug-in is a singleton checkbox. To simplify the creation of the new project we'll just copy the settings file (plugin.xml) from the existing project to the new one. Copy plugin.xml file from the existing project (server) into clipboard. And paste it to the new project. Note there appeared a warning in the Problems tab. We should fix it. Right click on the warning, then select Quick Fix. Then click Finish . Then we should update plugin.xml file by specifying a new url address for the second project. Two projects can't have the same url. Double click on plugin.xml file. In the configuration editor open plugin.xml tab. Then update alias attribute of the resource tag. Let's name it "second". Don't forget to save the file after editing. The next step is creating a web folder in the project and putting an html file into it.Create new web plug-in project named "jquery". Do the same the steps that we made for the previous project. They are:
<script type="text/javascript" src="../jquery/jquery-2.1.1.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#message').text('jQuery is working'); }); </script>You should also add an h3 element to the html. Don't forget to save the file.
We have moved our javascript library out of the project code. This is a good practice keeping libraries aside.