我使用jQuery對話框中模態對話框顯示HTML文件:點擊鏈接jQueryUI的對話框
主站點調用的test.html:
<body>
<div id="layer" style="display: none;">
</div>
</body>
<script type="text/javascript">
$("#layer").dialog({
dialogClass: 'noTitleStuff',
autoOpen: false,
position : ['center',20],
/*draggable: false, */
resizable : true,
modal : true,
show : 'fade',
hide : /*'drop'*/'fade',
width: 'auto',
heigth: 'auto',
open: function() {
$(".ui-dialog-titlebar").removeClass('ui-widget-header');
},
});
$(function() {
$("#layer").load('test.php', function() {
$("#layer").dialog("open");
});
});
</script>
能正常工作和測試的內容.php顯示得很好。但是當我點擊test.php中的鏈接時,鏈接在整個瀏覽器窗口中打開。我怎樣才能在對話框中顯示新的網站呢?
感謝您的幫助
你有在你面前的答案!你需要將新的URL加載到對話框中。 – Mathletics
在對話框中添加一個iframe,然後在其中打開url。 –