coliff / bootstrap-ie11

Internet Explorer 11 compatibility solution for Bootstrap 5
https://coliff.github.io/bootstrap-ie11/
MIT License
96 stars 15 forks source link

Hi, Why can't I use javascript code.. Thanks #104

Closed Amnhed closed 2 years ago

Amnhed commented 3 years ago

Hi, Why can't I use javascript code in IE.. Thanks

<a class="btn header-button"><i class="bi bi-house fw-bold"></i><span class="fw-bold" onclick="hola()"> Home</span></a>
<!doctype html>
<html lang="en">

<head>
  <!-- Required meta tags -->
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <!-- Bootstrap CSS -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
    integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.0/font/bootstrap-icons.css">
  <link rel="stylesheet" href="./css/estilos.css">

  <!-- Compatible with IExplorer CSS -->
  <link rel="stylesheet" href="./css/bootstrap-ie11.css">
  <script src="https://code.jquery.com/jquery-3.6.0.slim.js"></script>
  <script nomodule="" crossorigin="anonymous"
    src="https://polyfill.io/v3/polyfill.min.js?features=default%2CNumber.parseInt%2CNumber.parseFloat%2CArray.prototype.find%2CArray.prototype.includes">
    </script>
  <script nomodule="">window.MSInputMethodContext && document.documentMode && document.write('<script src="https://cdn.jsdelivr.net/combine/npm/bootstrap@5.0.0-beta2/dist/js/bootstrap.bundle.min.js,npm/ie11-custom-properties@4,npm/element-qsa-scope@1"><\/script>');
  </script>

  <title>Portal de Servicios al Contribuyente</title>
</head>

<body>
      <div class="justify-content-between">
        <ul id="horizontal-list">
          <li>
            <a class="btn header-button"><i class="bi bi-house fw-bold"></i><span class="fw-bold" onclick="hola()"> Home</span></a>
          </li>
          <li>
            <a class="btn header-button-siigem"><i class="bi bi-door-closed"></i><span class="fw-bold">
                Siigem</span></a>
          </li>
          <li>
            <a class="btn header-button-sesion"><span class="fw-bold"><i class="bi bi-key"></i> Iniciar
                sesión</span></a>
          </li>
          <li>
            <a class="btn header-button"><span class="fw-bold"><i class="bi bi-lock"></i> Crear contraseña</span></a>
          </li>
        </ul>
      </div>
  </div>

  <!-- Optional JavaScript; choose one of the two! -->

  <!-- Option 1: Bootstrap Bundle with Popper -->
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
    integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
    crossorigin="anonymous"></script>

  <!-- Option 2: Separate Popper and Bootstrap JS -->
  <!--
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js" integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script>
    -->
  <script src="./js/principal.js"></script>
</body>

</html>
<script>

  function hola(){
    alert("hola");
  }
</script>
coliff commented 3 years ago

You can use JavaScript code in IE. I just tested your above code in IE11 on Windows 10 and it works fine.

image