以下代碼部分來自彈出式警報窗口,在如何使用的示例頁面中有一個按鈕,指出「錯誤」,並且當您單擊它時窗口出現。在按鈕內部運行代碼而不點擊它
<button class="btn btn-danger notification" data-verti-pos="bottom" data-horiz- pos="right" data-message="<i class='fa fa-frown-o' style='padding-right:6px'></i> Oops... Something went wrong. Hope we don\'t see me again." data-type="error" type="button"></button>
問題是,我想調用窗口,而不需要點擊按鈕,我試圖調用它,如果有條件。
if(codigo=="matricula_longitud"){
//I know the part of code below is totally wrong
document.getElementById("errores").innerHTML='<div class="alert alert-warning fade in"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><strong>Warning!</strong> Better check yourself, youre not looking too good.</div>';
return "si";
}
我是新來編程,所以任何意見將不勝感激。 謝謝。
非常感謝您的幫助:) – Marcos