![](/img/trans.png)
[英]xmlHttpRequest.open() (Ajax) -> use a PHP method as “URL”-parameter
[英]Can you use xmlhttprequest.open and xmlhttprequest.send to open a new window?
我需要一個彈出式編輯器。 用戶選擇要編輯的內容,該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();
}
得到它了
父window.open('editPopup.php','Edit','width = 300,height = 200');
彈出
opener.document.getElementById('txtHint')。innerHTML ='父窗口的更新內容';
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.