#填坑# IDEA中maven依赖方式引入jquery依赖以及前端页面导入js

首先确保pom文件中引入依赖正确:

  <dependency>
       <groupId>org.webjars</groupId>
       <artifactId>stomp-websocket</artifactId>
       <version>2.3.3</version>
 </dependency>
<dependency>
        <groupId>org.webjars</groupId>
        <artifactId>jquery</artifactId>
        <version>3.4.1</version>
</dependency>
<dependency>
        <groupId>org.webjars</groupId>
        <artifactId>jquery</artifactId>
        <version>3.4.1</version>
</dependency>

其次,在前端html页面中引入js:

    <script src="/webjars/jquery/jquery.js"></script>
    <script src="/webjars/sockjs-client/sockjs.js"></script>
    <script src="/webjars/stomp-websocket/stomp.js"></script>

完事儿,就这么简单……网上写得都是啥玩意儿……

你可能感兴趣的:(后端坑,java,maven,js,spring,boot)