0
我知道這是非常基本的,但我找不到答案。如何在一個條件內調用彈出窗口?例如:Popup.js - 調用彈出框
if(error.length != 0){
console.log(error);
popup({
content : '<p>Not allowed</p>',
type : 'html'
});
}
我的頁面包含一個進口
<script src="<c:url value='/resources/js/jquery.popup.min.js' />"></script>
我得到一個錯誤:
Uncaught ReferenceError: popup is not defined
存在控制檯沒有錯誤,但一個彈出窗口不會出現 – thinker
然後檢查腳本網址。我的意思是你說它是正確的? – ab29007
代碼沒有顯示錯誤,也許是因爲瀏覽器。試試這個:能夠在你的瀏覽器中禁用「阻止彈出窗口」。也可以嘗試不同瀏覽器中的代碼。 – ab29007