window.location重定向到IE11中的主页& Mozilla浏览器

时间:2014-01-29 09:22:13

标签: javascript php jquery joomla2.5

我在IE11& amp; 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>

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

1 个答案:

答案 0 :(得分:0)

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