你好,我儘量讓jQuery的對話框彈出(模式),可以在彈出窗口切換到其他頁面(在裝載其他頁面存在彈出)可以jQuery的對話框模態更改頁面內模態?
,但我不知道如何來加載內模態的test3.php編碼在test2.php
,這裏是我的嘗試
test1.php
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Dialog - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
</head>
<body>
<button id="btn">Click to Popup</button>
<div id="dialog" title="Basic dialog">
here
</div>
<script>
$(function() {
$("#dialog").dialog({
open: function(event, ui) {
$('#dialog').load('test2.php', function() {
alert('Load was performed.');
});
},
modal: true,
autoOpen: false,
title: "jQuery Dialog",
width: 600,
height: 350
});
$("#btn").click(function(){
$('#dialog').dialog('open');
});
});
</script>
</body>
</html>
test2.php
this is test2.php page <br/>
<a href="test3.php"> Go to Page test3.php </a>
test3.php
<p> this is test3.php page </p>
檢查您的瀏覽器控制檯..您看到任何錯誤嗎? –
不,我只是不知道如何編寫test2.php頁面中的代碼.load(),因爲test2.php中只有2行代碼 – doflamingo