2017-07-11 57 views
-2

有誰知道爲什麼我的jQuery不會運行?我試着運行按鈕點擊或頁面加載,但它不工作。由於爲什麼jquery不能在我的網頁上運行?

<head> 
 
    <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> 
 
    <script src="js/bootstrap.min.js"></script> 
 
</head> 
 
<body> 
 
    <iframe style="width:100%;height:700px;" id="frame" src="bing.com"> 
 
    <script> 
 
     $(document).ready(function() { 
 
      alert("working"); 
 
     }); 
 
    </script> 
 
</body>

+1

在您的瀏覽器控制檯的任何錯誤?順便說一句,你的代碼有缺少''和'' –

+0

你忘記了開頭''。除了它的作品。 – litelite

+0

我確實有一個開放的身體。 DId不會粘貼在這裏 – 123

回答

1

您需要關閉您的iframe標籤,放在了完整的URL是這樣的:

<head> 
 
    <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> 
 
    <script src="js/bootstrap.min.js"></script> 
 
</head> 
 

 
<body> 
 
    <iframe style="width:100%;height:700px;" id="frame" src="http://bing.com"></iframe> 
 
    <script> 
 
    $(document).ready(function() { 
 
     alert("working"); 
 
    }); 
 
    </script> 
 
</body>

相關問題