當我提交表單時,會彈出一個窗口到另一個URL。如果我關閉彈出窗口並重新填寫窗體,窗口會在新選項卡中打開,直到我重新加載頁面。我怎樣才能讓窗口在每次彈出時彈出,而無需重新加載頁面?使用Javascript彈出窗口每頁只能彈出一次加載
<form action="http://stackoverflow.com/" method="post" enctype="multipart/form-data" name="imgform" onsubmit="process(); return false;">
// FORM PARAMS
<input type="submit" name="submit" value="Submit" />
</form>
JavaScript函數:
document.imgform.setAttribute('onsubmit','');
你清除你process
功能的JavaScript調用這將打開彈出:
process = function(){
popWindow = window.open('','popup','width=800,height=600,resizable=yes');
document.imgform.setAttribute('target','popup');
document.imgform.setAttribute('onsubmit','');
document.imgform.submit();
};