此代码无法在Firefox中正常运行。在IE中完美运行

此代码无法在Firefox中正常运行。在IE中完美运行

问题描述:

<asp:ImageButton ID="imgbtn" Width="25px" Height="25px" ImageAlign="Right"runat="server" Visible="true" OnClick="log_Click"  OnClientClick="openWindow()" />













var newWindow = null;
        function openWindow() {

            if (newWindow != null)
                newWindow.close(); // for close opened window
            newWindow = window.open("demo.aspx?xxxx=" + "1200" + "&sada=", 'mywindow', 'height=750,width=1200, menubar=0, resizable=yes');
            //alert('close',20)
            newWindow.focus();
            newWindow.location.reload();
           }







开始弹出浏览器窗口确实有任何数据(只是空白)。如果我正在设置警告msg意味着我在弹出浏览器中有数据。




The opening popup browser window does have any data(simply blank). if i'm setting alert msg means i have data in popup browser.

不确定这是否是您的问题,但您是否注意到 Window.open() [ ^ ]:

Not sure if this is your problem but have you noticed from Window.open()[^]:
请注意远程URL不会立即加载。当window.open()返回时,窗口始终包含about:blank。 URL的实际提取是延迟的,并在当前脚本块完成执行后启动。窗口创建和引用资源的加载是异步完成的。
Note that remote URLs won't load immediately. When window.open() returns, the window always contains about:blank. The actual fetching of the URL is deferred and starts after the current script block finishes executing. The window creation and the loading of the referenced resource are done asynchronously.