2014-10-09 52 views
0

在我的應用程序中,彈出一個新窗口,然後在其上設置響應顯示。 它適用於我的開發和測試環境(IE10,IE9,IE11)中的所有瀏覽器版本。 但是,在我的客戶使用與我的IE版本相同的瀏覽器中,它不起作用。他們說他們更新了微軟的一些安全補丁。我試圖在Chrome上運行,並且工作。我嘗試了一些方法來模擬我的電腦中的問題,但瀏覽器仍然可以顯示響應。 有什麼配置可以在瀏覽器上解決它?以下是我的代碼。IE在新彈出窗口中不顯示響應

var etc = "channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=1,toolbar=0" + ",scrollbars=no,left = 0 , top = 0 , height=" + screen.availHeight + " , width=" + screen.availWidth ; 
var newWindow = window.open('', "MyWindow123", etc); 
newWindow.focus(); 
document.forms[0].target="MyWindow123"; 
d.action="POST"; 
d.submit(); 

回答

0

你有一些問題

    在貼
  • , 「d」 未設置
  • d.action設置爲 「POST」,但你的意思d.method或d.action = 「someurl」
  • 你很可能有安全問題。這也可能是一個時間問題。在IE
  • 中衆所周知的顯示您所發佈的聲明的內容。如果它是一個鏈接,你需要取消點擊

試試這個,我也移除了PARMS所有非法的空間和刪除不必要的:

function myPost() { 
    var etc = "resizable,scrollbars,status,left=0,top=0,height="+screen.availHeight+",width="+ screen.availWidth; 
    var newWindow = window.open('', "MyWindow123", etc); 
    if (newWindow) { 
    newWindow.focus(); 
    var d = document.forms[0]; 
    d.target="MyWindow123"; 
    d.method="POST"; // NOT action!!! 
    setTimeout(function() {document.forms[0].submit();},300); 
    } 
    else { 
    alert("Sorry your browser does not allow popups"); 
    } 
    return false; // cancel the event 
} 

假設(內嵌在這裏,不顯眼越好)

<a href="pleaseenablejavascript.html" 
    onclick="return myPost()">Submit</a> 

<form action="someurl" onsubmit="return myPost()">... 
0

感謝您的回答,

這是我校

function myPost() { 
    var etc = "resizable,scrollbars,status,left=0,top=0,height="+screen.availHeight+",width="+ screen.availWidth; 
    var newWindow = window.open('', "MyWindow123", etc); 
    if (newWindow) { 
    newWindow.focus(); 
    var d = document.forms[0]; 
    d.target="MyWindow123"; 
    d.method="POST"; // NOT action!!! 
    d.action="signIn"; 
    setTimeout(function() {document.forms[0].submit();},300); 
    } 
    else { 
    alert("Sorry your browser does not allow popups"); 
    } 
    return false; // cancel the event 
} 

而且功能是通過圖像

<img src="images/iconlogon.gif" alt="" onClick="return myPost();" >

我試過的OnClick事件調用,但反應仍然不顯示在彈出式屏幕中。