Javascript 按钮只适用于Internet Explorer

Javascript 按钮只适用于Internet Explorer,javascript,html,web,Javascript,Html,Web,我正试图解决我父亲的企业系统内部的一个问题,该系统有一个按钮,只能在Internet Explorer上工作,在其他浏览器中无法工作,因此无法使用iPad或其他操作系统在该系统中工作。。。他们从一家名为Linx的企业购买了这个系统,我想这个系统的代码太危险了,在客户端javascript上处理查询。 如果你知道为什么这只是在IE浏览器上工作,我会非常棒! 谢谢你的建议。。。 观察:我只是复制了按钮的html和按钮的javascript函数,然后粘贴到这里 <script> f

我正试图解决我父亲的企业系统内部的一个问题,该系统有一个按钮,只能在Internet Explorer上工作,在其他浏览器中无法工作,因此无法使用iPad或其他操作系统在该系统中工作。。。他们从一家名为Linx的企业购买了这个系统,我想这个系统的代码太危险了,在客户端javascript上处理查询。 如果你知道为什么这只是在IE浏览器上工作,我会非常棒! 谢谢你的建议。。。 观察:我只是复制了按钮的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()">

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

很抱歉,我没有答案,但我必须指出:这可能是我见过的最严重的安全漏洞!它适合Dailywtf.com的入口!!!当向新手程序员教授SQL注入时,这应该作为最坏的情况使用……您的问题似乎自相矛盾。首先你说这个按钮只在IE上起作用,然后你问为什么这个按钮在IE上不起作用。你能澄清它是哪一个吗?从那里开始,也许可以检查屏幕右下角的状态栏中是否有JS错误。若你们在Chrome中测试这个,你们应该能够按CTRL+SHIFT+I,并在控制台上查看是否有任何错误。我不知道。可能会更糟…尝试从parent.frames.Principal.location更改为parent.frames.Principal.location.hrefSorry,写入错误,问题是为什么这在其他浏览器中不起作用,只是在IE中,我已经编辑了这个问题。它仍然不起作用,在chrome上,错误消息说:。。没有定义