为什么这个javascript代码没有在FireFox中运行 如果(window.name=='default'){ window.name='a03d01c6c88549c6a7e05c922961271e'; window.document.getElementById('ctl03')。单击(); } else if(window.name==''){ window.name='default'; window.document.getElementById('ctl04')。单击(); } else if(window.name==“invalidAccess”){ 如果('FALSE'='TRUE') { window.name=''; window.document.getElementById('ctl04')。单击(); } 其他的 { window.open('MsgPage\u NewWindow.aspx','u self'); } } 否则{ window.name='invalidAccess'; window.document.getElementById('ctl04')。单击(); }

为什么这个javascript代码没有在FireFox中运行 如果(window.name=='default'){ window.name='a03d01c6c88549c6a7e05c922961271e'; window.document.getElementById('ctl03')。单击(); } else if(window.name==''){ window.name='default'; window.document.getElementById('ctl04')。单击(); } else if(window.name==“invalidAccess”){ 如果('FALSE'='TRUE') { window.name=''; window.document.getElementById('ctl04')。单击(); } 其他的 { window.open('MsgPage\u NewWindow.aspx','u self'); } } 否则{ window.name='invalidAccess'; window.document.getElementById('ctl04')。单击(); },javascript,firefox,Javascript,Firefox,上面的脚本是由服务器控件在网页上发出的。。。除了页面之外,页面中没有其他控件。。。Internet Explorer将其重定向到“Home.aspx”页面,但Firefox只是停留在同一页面上。。。注意,即使它显示任何错误 你能帮忙吗。我还想知道这样做的原因,因为我必须使整个web应用程序在FF中工作。您正在使用专有的IE only单击方法重定向 您应该编写location.href=”http://url";取而代之;这将适用于所有浏览器。您正在使用专有的IE only单击方法重定向 您应该编

上面的脚本是由服务器控件在网页上发出的。。。除了页面之外,页面中没有其他控件。。。Internet Explorer将其重定向到“Home.aspx”页面,但Firefox只是停留在同一页面上。。。注意,即使它显示任何错误


你能帮忙吗。我还想知道这样做的原因,因为我必须使整个web应用程序在FF中工作。

您正在使用专有的IE only
单击
方法重定向


您应该编写
location.href=”http://url";取而代之;这将适用于所有浏览器。

您正在使用专有的IE only
单击
方法重定向


您应该编写
location.href=”http://url";取而代之;这在每个浏览器中都适用。

您是否正在工具->错误控制台下查看?如果您这样做,您将看到类似“单击不是功能”的内容,请尝试简单地设置.location。

您正在工具->错误控制台下查看吗?如果您这样做了,您将看到类似“单击不是函数”的内容,请尝试简单地设置.location

   <script type="text/javascript">

 if (window.name == 'default') {
        window.name = 'a03d01c6c88549c6a7e05c922961271e';
        window.document.getElementById('ctl03').click();
    }
    else if (window.name == '') {
        window.name = 'default';
        window.document.getElementById('ctl04').click();
     }
    else if (window.name == 'invalidAccess') {
        if ('FALSE' == 'TRUE')
        {
         window.name='';
        window.document.getElementById('ctl04').click();
        }
        else
        {
            window.open('MsgPage_NewWindow.aspx','_self');
        }
    }
    else {
        window.name = 'invalidAccess';
        window.document.getElementById('ctl04').click();
    }
</script>