2016-04-23 76 views
0
<head> 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"> 
    src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"> 
    </script> 
</head> 

<script> 
function confirm() { 
BootstrapDialog.confirm('Are you sure you want to do this?');} 
</script> 

<input type="button" value="confirm" onclick="confirm()" /> 

嗨。我試圖做一個由按鈕輸入激活的引導確認提醒。我是一個初學者,所以它可能是基本的/明顯的,我失蹤了...非常感謝任何幫助。麥克風。bootstrap確認框警報不起作用

+0

腳本標記不正確,每個URL需要一個開放腳本標記,其中包含一個源代碼,後跟一個關閉腳本標記。 – adeneo

+0

看看這個問題:http://stackoverflow.com/questions/8982295/confirm-delete-modal-dialog-with-twitter-bootstrap –

+0

另外,是不是BootstrapDialog一個插件? – adeneo

回答

0

幾件事情:

  • script標籤不正確,需要固定
  • 你最有可能需要的bootstrap.css
  • 你需要添加bootstrap-dialog.js

function confirm() { 
 
    BootstrapDialog.confirm('Are you sure you want to do this?'); 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> 
 
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> 
 
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.35.1/js/bootstrap-dialog.min.js"></script> 
 
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" /> 
 

 
<input type="button" value="confirm" onclick="confirm()" />

+0

謝謝 - 現在所有的工作 – MikeMcClatchie