How to include the jQuery library in a Spring-MVC Eclipse project

前端 未结 7 1192
感动是毒
感动是毒 2020-12-31 14:58

Good day,

I have searched far and wide but all I can find is information about how to add various plugins to Eclipse. I don\'t want a plugin. I want my stinkin\' jQu

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-31 15:20

    Option 1

    Include jquery.js in your project

    1. Get jQuery.
    2. Put the jQuery.js file somewhere under the web root, but not under WEB-INF. Perhaps, create a directory named "js" at the same level as the WEB-INF folder in your project (for me, this is under the WebContext folder).
    3. Reference the jquery.js file in your JSP page (example below).

    Reference jQuery.js within project


    or (to include your context path in the reference if you are using JSTL mapped to prefix "c")

    Option 2

    1. Don't get jquery.js
    2. Load jquery from google CDN. (see below)

    Reference jQuery.js from Google CDN

提交回复
热议问题