我想在我的主頁上調用一個按鈕從另一個頁面調用模式。加載ajax頁面中的引導模態,並自動啓動該模式,所有一次
我需要這個模式在加載後自動啓動。
我沒有找到任何關於它的信息。 (還是我錯過嗎?!)
我的代碼:
我打電話這個js功能:
<script>
function startb(plc)
{
$.ajax({
url: "gb.php?plc="+plc
}).done(function(data) {
$("#large-div").html(data);
});
//the id of the modal in the gb.php code is: "inside-modal"
$('#inside-modal').modal('show');
}
</script>
<body>
<div id="large-div" name="large-div">
</div>
<button onclick="startb('28')">start plc</button>
</body>
向我們展示您嘗試過的方式,我很樂意幫助您瞭解您錯過的內容。 – technophobia
ajax您想要加載的頁面,然後在ajax完成時填充模式。這很容易。 – noob
我插入了代碼。感謝名單! – user3495363