简体   繁体   中英

error installing two jQuery scripts (conflict)

I have a problem installing two diferent jquery scripts, one script is for AutoComplete function, and another is a script i bought in codecanyon.net named Smart Alert.

Both scripts works fine when are separated, but when i try to put both in same page only one can works...

For example, test1.php:

http://www.tlmweb.tk/test1.php

please type "a" in the blue input field, and autocomplete will work, now click in the blue button named "Buscar" and nothing happens...

Now, test2.php (please use same link just change to test2.php):

please type "a" in the blue input field and nothing happens (autocomplete wont work) but please click in the blue buton named "Buscar" and Smart Alert will work fine...

Now, the only diference between both HTML codes is the line 44, where i removed script: for autocomplete.

So, if removed works smart alert , and of course, wont work autocomplete, if no removed works autocomplete but not smart alert...

Can anyone please help me to know how to fix this issue????

Please feel you free to view source code and JS scripts

Look at your browser console:

event.returnValue is deprecated. Please use the standard event.preventDefault() instead.

Your jQuery version is too old for your plugins. Please use a newer version of jQuery or fix it manually inside your plugin.

Edit: And you need to reorder your JS inclusion order. You need to define jQuery first, before you include jQuery UI or any plugin. Because both of them use jQuery.

Edit 2: I fixed your html head section. Just use this instead (and please fix the undisplayable utf-8 character in your script block):

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="icon" href="/favicon.ico?81796153" type="image/x-icon">
    <link rel="shortcut icon" href="/favicon.ico?84193814" type="image/x-icon">

    <title>Panel Administrativo - Vales</title>

    <link rel="stylesheet" type="text/css" href="css/reset.css">
    <link type="text/css" href="css/smoothness/ui.css" rel="stylesheet">
    <link href="alert/css/alert.css" rel="stylesheet">
    <link href="alert/themes/default/theme.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="css/960.css">
    <link rel="stylesheet" type="text/css" href="css/text.css">
    <link rel="stylesheet" type="text/css" href="css/blue.css">
    <link href="css/botones-btn.css" rel="stylesheet">
    <link href="content/styles.css" rel="stylesheet">
    <style type="text/css">
        #smartAlert[data-icon="error"] #smartAlertIcon {
        background-image: url(img/hand.png);
        }

        #smartAlert[data-icon="correcto"] #smartAlertIcon {
        background-image: url(img/confirm.png);
        }

        h1.ImagenNombreSec { background:url(../images/EmitirVales48.png) left 3px no-repeat; padding-left:60px;}
    </style>

    <script type="text/javascript">
        var Operadores = {
            "12": "PEDRO DE LOYOLA JUAREZ",
            "6": "RAUL GARCIA MARQUEZ",
            "10": "�ARIGON GOMEZ FARIAS",
            "14": "FIDEL ISLAS ISLAS",
            "9": "JAVIER LOPEZ CAMARENA",
            "5": "GERARDO MARQUEZ VELEZ",
            "7": "GABRIEL ENRIQUE MARTINEZ PEREZ",
            "13": "ISABEL PEREZ GODINES",
            "1": "JUAN PEREZ JOLOTE",
            "11": "JUAN PEREZ JOLOTE",
            "8": "MARIA DE TODOS LO ANGELES PEREZ GOMEZ"
        };
    </script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js"></script>
    <script type="text/javascript" src="js/blend/jquery.blend.js"></script>
    <script type="text/javascript" src="js/ui.core.js"></script>
    <script type="text/javascript" src="js/ui.sortable.js"></script>
    <script type="text/javascript" src="js/effects.js"></script>
    <script type="text/javascript" src="js/jquery.mockjax.js"></script>
    <script type="text/javascript" src="js/jquery.autocomplete.js"></script>
    <script type="text/javascript" src="js/ListarOperadoresAyuda.js"></script>
    <script src="alert/js/alert.js"></script>
    <script id="source" type="text/javascript" src="js/graphs.js"></script>
    <script type="text/javascript" src="js/fechayhora.js"></script>

    <!--[if IE]>
    <script language="javascript" type="text/javascript" src="js/flot/excanvas.pack.js"></script>
    <![endif]-->

    <script type="text/javascript" src="js/CambiosOP.js"></script>

    <!--[if IE 6]>
    <link rel="stylesheet" type="text/css" href="css/iefix.css" />
    <script src="js/pngfix.js"></script>
    <script>
        DD_belatedPNG.fix('#menu ul li a span span');
    </script>
    <![endif]-->
</head>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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