按钮只适用于Internet Explorer

时间:2012-01-16 13:21:31

标签: javascript html web

我正在尝试解决我父亲的企业系统中的问题,系统有一个按钮,只能在Internet Explorer上运行,它在其他浏览器中不起作用,因此无法在此系统中使用iPad工作或者另一个操作系统......他们从名为Linx的企业购买了这个系统,我猜这个系统的代码太危险了,在客户端(javascript)处理查询。

如果你知道为什么这只适用于Internet Explorer我会非常棒!
感谢您的建议......

观察:我刚刚复制了按钮的html和按钮的javascript功能,并粘贴在这里。

<script>
    function Query_onclick() {
        xwhere = "";
        xflag  = 1;

        if (xmodelos != ""){
            if (xwhere != "") {
                xwhere = xwhere + " and ";
            }
            xwhere = xwhere + " Modelagem = '" + xmodelos + "'";
        }

        if (xmateriais != "") {
            if (xwhere != "") {
                xwhere = xwhere + " and ";
            }
            xwhere =  xwhere + " Material = '" + xmateriais  + "'";
        }

        if (xgrupos != ""){
            if (xwhere != "") {
                xwhere = xwhere + " and ";
            }

            xwhere = xwhere + " Grupo_produto = '" + xgrupos  + "'";

        }

        if (xsubgrupos != "") {
            if (xwhere != "") {
                xwhere = xwhere + " and ";
            }

            xwhere =  xwhere + " Subgrupo_produto = '" + xsubgrupos  + "'";

        }

        if (xcategorias != ""){
            if (xwhere != "") {
                xwhere = xwhere + " and ";
            }

            xwhere = xwhere + " p.cod_categoria in (select cod_categoria from produtos_categoria where CATEGORIA_PRODUTO ='" + xcategorias  + "')";

        }

        if (xsubcategorias != ""){
            if (xwhere != "") {
                xwhere = xwhere + " and ";
            }

            xwhere = xwhere + " p.cod_subcategoria in (select cod_subcategoria from produtos_subcategoria where SUBCATEGORIA_PRODUTO ='" + xsubcategorias  + "')";

        }

        if (xfabricante != ""){
            if (xwhere != "") {
                xwhere = xwhere + " and ";
            }

            xwhere = xwhere + " Fabricante = '" + xfabricante  + "'";

        }

        if (xlinhas != "") {
            if (xwhere != "") {
                xwhere = xwhere + " and ";
            }
            xwhere = xwhere + " Linha = '" + xlinhas + "'";             
        } 

        if (xcomposicao != "") {
            if (xwhere != "") {
                xwhere = xwhere + " and ";
            }
            xwhere = xwhere + " composicao = '" + xcomposicao + "'";                
        }   

        if (xcolecoes != "") {
            if (xwhere != "") {
                xwhere = xwhere + " and ";
            }
            xwhere = xwhere + " Colecao = '" + xcolecoes + "'"; 
        } 

        if (xgriffes != ""){
            if (xwhere != "") {
                xwhere = xwhere + " and ";
            }
            xwhere = xwhere + " Griffe = '" + xgriffes + "'";
        }

        if (xtipos != ""){
            if (xwhere != "") {
                xwhere = xwhere + " and ";
            }

            xwhere = xwhere + " Tipo_produto = '" + xtipos + "'"; 

        }


        if (produto.value != "") {
            if (xwhere != "") {
                xwhere = xwhere + " and ";
            }

            xwhere = xwhere + " produto like '" + Urlencode("%" +  produto.value + "%") + "'";

        }

        if (descricao.value != "") {
            if (xwhere != "") {
                xwhere = xwhere + " and ";
            }

            xwhere = xwhere + " desc_produto like '" + urlencode(descricao.value) + "'";

        }

        if (xwhere != ""){
            if ( Foto.checked == 1) {
                xfoto = "&xfoto=" + Foto.checked;           
            }
            else {
                xfoto = "&xfoto=false"; 
            }   
            parent.frames.Principal.location = "../pages/cat_prods.asp?xwhere=" + xwhere + xfoto;
        }
        else{
            if ( Foto.checked == 1) {
                xfoto = "?xfoto=" + Foto.checked;           
            }
            else {
                xfoto = "?xfoto=false"; 
            }   

            parent.frames.Principal.location = "../pages/cat_prods.asp"+ xfoto;
        }
    }
</script>

<input type="Image" src="image.png" name="Query" value="     Pesquisar   " onclick="Query_onclick()">

1 个答案:

答案 0 :(得分:1)

您可以尝试从parent.frames.Principal.location更改为parent.frames.Principal.location.href