0

单击这些链接中的任何(.sce_edit_link_a、.sce_edit_link_short、.sce_image_link、.sce_file_link)时,它将使用 iframe 在 iframe 中显示它们的内容

link = $(this).attr('href');
        $('#sce_frame').attr('src', link);

反正有没有在弹出窗口而不是 iframe 中显示它们?

<!--V.0.7-->
<div class="sce_hidden">
    <div id="edit_mode">
        <iframe src="#" style="width:100%; height:100%;" frameborder="0" name="sce_frame" id="sce_frame" scrolling="no"></iframe>
    </div>
</div>

<script type="text/javascript">
$(document).ready(function(){
    $('.sce_edit_link_a, .sce_edit_link_short, .sce_image_link, .sce_file_link').click(function(){
        link = $(this).attr('href');
        $('#sce_frame').attr('src', link);

        $( '#edit_mode' ).dialog({
            width: 500,
            height: 500,
            resizable: true,
            buttons: [{
                text: '<?php echo(lang_front_close); ?>',
                click: function(){ $(this).dialog('close'); window.location.reload();}
            }]
        });

        return false;
    });

    $('#sce_controlcenter').click(function(){
        link = $(this).attr('href');
        $('#sce_frame').attr('src', link);

        $( '#edit_mode' ).dialog({
            width: 500,
            height: 500,
            resizable: true,
            buttons: [{
                text: '<?php echo(lang_front_close); ?>',
                click: function(){ $(this).dialog('close'); window.location.reload();}
            }]
        });

        return false;
    });

    $('#sce_reloadpage').click(function(){
        window.location.reload();
        return false;
    });
});

<?php
if($_GET['reload']=='yes'){
    echo('window.location.href = \'//'. $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'].'\';');
}
?>
</script>
4

1 回答 1

0

使用window.open而不是设置 iframe src

link = $(this).attr('href');
window.open(link,"windowName","resizable,scrollbars,status");

window.open MDN 文档

于 2013-09-22T15:07:06.727 回答