jQuery未处理的异常如何处理此异常

时间:2019-11-29 04:54:57

标签: jquery html bootstrap-4

http://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js中第3行第147列的未处理异常

0x800a01b6-JavaScript运行时错误:对象不支持属性或方法'addEventListener'

代码:

ERROR: Skipping 'l1-cache-line-size=64': couldn't determine target from filename 'l1-cache-line-size=64'
ERROR: couldn't determine target from filename 'l1-cache-line-size=64'

以上代码生成异常

1 个答案:

答案 0 :(得分:1)

我发现了您的问题,请在引导脚本之前添加jquery

<!DOCTYPE html>
<html lang="en">

<head>
  <title> Login form </title>
  <link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">

  <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

  <style type="text/css">
    body {
      margin: 0;
      padding: 0;
      background-color: #17a2b8;
      height: 100vh;
    }
    
    #login .container #login-row #login-column #login-box {
      margin-top: 120px;
      position: center;
      max-width: 600px;
      height: 320px;
      border: 1px solid #9C9C9C;
      background-color: #EAEAEA;
    }
    
    #login .container #login-row #login-column #login-box #login-form {
      padding: 20px;
    }
  </style>
</head>

<body>
  <div id="login">
    <h3 class="text-center text-white pt-5">Login form</h3>
    <div class="container">
      <div id="login-row" class="row justify-content-center align-items-center">
        <div id="login-column" class="col-md-6">
          <div id="login-box" class="col-md-12">
            <form id="login-form" class="form" action="" method="post">
              <h3 class="text-center text-info">Login</h3>
              <div class="form-group">
                <label for="username" class="text-info">Employee ID :</label><br>
                <input type="text" name="username" id="username" class="form-control">
              </div>
              <div class="form-group">
                <label for="password" class="text-info">Password:</label><br>
                <input type="password" name="password" id="password" class="form-control">
              </div>
              <div class="form-group">

                <input type="submit" name="submit" class="btn btn-info btn-md" value="submit">
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</body>

</html>

相关问题