dou426098 2012-11-20 06:26
浏览 195
已采纳

将动态内容传递给模态框,php和jquery

I was originally using a popup window to display dynamic information when the user clicked a button:

newwindow=window.open('popup.php?ID=' + id,'name','height=500,width=500');

I switched to a modalbox set up using this

To open the modal box I'm using openDialog($('#content')); where content is a div container.

how can I open the modal box and pass the same php file I was using in the popup window? 'popup.php?ID=' + id

thanks

  • 写回答

1条回答 默认 最新

  • dqmfo84644 2012-11-20 06:30
    关注

    You could load the content first using AJAX, opening the dialog in the complete callback

    $('#content').load('popup.php?ID=' + id, function() {
        openDialog($('#content'));
    });
    

    Docs for .load()

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?