在window.history.back()上工作时IE的浏览器问题

时间:2014-01-16 09:47:39

标签: javascript visualforce

我们有一个名为QuoteEdit2的VF页面,它在新窗口中打开SAP CRM链接。

使用此Create Quote VF页面覆盖自定义按钮QuoteEdit2和Quote对象的标准“编辑”链接。因此,一旦用户创建/编辑引用(例如从机会屏幕引用相关列表),他就会被重定向到QuoteEdit2 VF页面。

从UI角度来看,VF页面基本上是一个空白页面,但在新窗口中打开SAP CRM屏幕。

要求是将用户重定向回上一页(在本例中为Opportunity页面)。

该要求已成功实施,并且在Chrome浏览器中正常运行。但是当谈到IE浏览器时,它无法正常工作。

在QuoteEdit2 vf page:

中维护的代码示例
<script>        
    window.onLoad = new function(){                          
        var QuoteUrl = '{!QuoteUrl}';                
            childwindow = window.open(QuoteUrl,'_blank','height=' + screen.height + ',width=' + screen.width + 'channelmode=1,titlebar=1,menubar=0,location=0,toolbar=0');
            childwindow.focus(); 
            checkWindowStatus();
        }       
    function checkWindowStatus() 
    { 
        intervalId = setInterval(checkAndCloseWin, 2*1000);   
    }        
    function checkAndCloseWin() 
    { 
        if(childwindow.closed) 
        { 
           clearInterval(intervalId);
           //window.history.back(); 
           window.history.go(-1);
        } 
    }         
</script>

http://i.stack.imgur.com/szBJk.png

1 个答案:

答案 0 :(得分:2)

试试这个window.history.go(-1);