具有iframe的HTML代码无法在Mozilla和Edge中运行

时间:2018-07-13 09:49:15

标签: html iframe

我是编码新手,正在实现chatbot,并且在chrome中工作正常。但是,当我在mozilla和edge中进行尝试时,当我提供输入时,它不会接受输入。 下面是我在边缘检查元素时遇到的错误。谁能告诉我我在做什么错,请告诉我是否需要对代码进行任何更改。

enter image description here

这是我的html代码。

// Get the modal
var newmodal = document.getElementById('myModal');

// Get the button that opens the modal
var btn = document.getElementById("myBtn");

// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];

// When the user clicks the button, open the modal 
btn.onclick = function() {
  newmodal.style.display = "block";
}
// When the user clicks on <span> (x), close the modal
span.onclick = function() {
  newmodal.style.display = "none";
}

// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
  if (event.target == modal) {
    modal.style.display = "none";
  }
}
.newmodal {
  width: 300px;
  background-color: white;
  position: absolute;
  bottom: 41px;
  right: 43px;
  display: none;
}

.click-meq {
  height: 60px;
  width: 60px;
  position: absolute;
  bottom: 10px;
  right: 10px;
}

img {
  position: fixed;
  bottom: 15px;
  right: 15px;
  height: 60px;
  width: 60px;
}

.click-me1 {
  height: 40px;
  background-color: blue;
  color: white;
  width: 300px;
  position: absolute;
  bottom: 0;
  right: 10px;
}
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>


<div class="container-fluid">
  <div class="newmodal" id="myModal">
    <div class="close-btn">
      <span class="close">&times;</span>
    </div>

    < "MY Iframe Here">
  </div>
  <button class="click-me" id="myBtn"><img src="C:\Users\Resemble\Downloads\chat1.png"></button>
</div>

0 个答案:

没有答案