0

我需要一个弹出式编辑器。用户选择要编辑的内容,id 将被发送到新窗口,我将从数据库中检索数据,显示记录,允许用户更新并保存更改。更改完成后,窗口将关闭并更新原始表格以显示更改。

你可以使用 xmlhttprequest.open 和 xmlhttprequest.send 打开一个新窗口吗?

这是我正在做的一个示例,我希望能够在新窗口中打开页面。

function myfunction(date)
{
    date = document.getElementById('date').value;

    if (date == "")
    {
    document.getElementById("txtHint").innerHTML="";
    return;
    } 

    if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
    }

    else
    {// code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }

    xmlhttp.onreadystatechange=function()
    {
    if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
        document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
        }
    }

    xmlhttp.open("GET","want_to_open_in_new_window.php?a="+date,true);

    xmlhttp.send();   
}
4

1 回答 1

0

知道了

父window.open('editPopup.php','编辑','width=300,height=200');

弹出

opener.document.getElementById('txtHint').innerHTML = '父窗口的更新内容';
于 2013-08-08T00:26:34.173 回答