zoukankan      html  css  js  c++  java
  • .append无法加载已有js文件,解决实例

    js:

     1 /**
     2  * 
     3  */
     4  $(function(){
     5     $(document).on("click","a",function(){
     6                     alert("点击成功");
     7                 });
     8 
     9     $("#add").click(function(){
    10     $("#mydiv").append("<a>点击</a>");
    11     });
    12 });

    html:

     1 <%@ page language="java" contentType="text/html; charset=UTF-8"
     2     pageEncoding="UTF-8"%>
     3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
     4 <html>
     5 <head>
     6 <script type="text/javascript" src="assets/jquery-3.3.1.min.js"></script>
     7  <script type="text/javascript" src="test.js"></script>  
     8 <script type="text/javascript">
     9 </script>
    10 </head>
    11 <body>
    12 
    13 <a>点击</a><button id="add">add</button>
    14 <div id="mydiv"></div>
    15 </body>
    16 </html>
  • 相关阅读:
    工作的开端五
    工作的开端一
    工作的开端四
    工作的开端三
    工作的开端二
    springMVC基础配置
    3
    2
    文件操作Utils方法1
    解压zip并解析excel
  • 原文地址:https://www.cnblogs.com/smartisn/p/14360944.html
Copyright © 2011-2022 走看看