繁体   English   中英

window.location重定向到IE11和mozilla中的主页

[英]window.location redirect to the home page in IE11 & mozilla

我面临着IE11和Mozilla的奇怪问题,我使用window.location或document.location.href和window.location.href来重定向到特定链接,并且它在所有浏览器和IE 7,8版上运行良好, 9,10但是没有使用IE11和mozilla最新版本,我已经搜索了很多但是找不到任何解决方案。 这是我的代码尝试过:

<?php 
    $conc_getval2 =  JURI::root()."index.php?option=com_reconciliation&view=reconciliation&Itemid=135".$conc_getval;
?>
<a href="#" name="Client" title="Client" onclick="sortsection('getorderClient'); ">
  <?php echo JText::_('Client'); ?>
  <?php if(isset($getorderClient) && $getorderClient !=""){ ?>
    <img border="0" width="20" id="ascdec_img" name="ascdec_img" alt="<?php echo $alttagClient; ?>" title="<?php echo $alttagClient; ?>" align="absmiddle" src="<?php echo $imgClient; ?>"  />
  <?php } ?>
</a>

<script type="text/javascript">
function sortsection(gettype){
    var geturl = "<?php echo $conc_getval2; ?>";

    switch(gettype) {
    //alert(gettype);
    case 'getorderClient':
        var getorder = "<?php echo $_GET['getorderClient']; ?>";
        if(getorder == ""){
            var getorder = 'DESC';
            var mod_url = geturl+"&getorderClient=DESC";
        } else {
            if(getorder == "DESC"){
                var mod_url = document.URL.replace("DESC", "ASC");
            } else {
                var mod_url = document.URL.replace("ASC", "DESC");
            }
        }
        window.event.returnValue = false;   
        window.location = mod_url;
        //document.location.href = mod_url;
        break;
    }
}
</script>

请帮我解决这个问题。谢谢。

window.event在firefox中不存在,因此产生了js错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM