Jquery version giving problems

0

I'm having problems because my site is done with Jquery 1.4.1.min and when I call a script like this:

<select  class="styledselect_pages" onchange="mudalinhas(this.value) ">  

Script with this version of jquery does not work:

  <script src="https://code.jquery.com/jquery-1.4.1.min.js"></script>

Butwiththisversionalreadyworks:

<scriptsrc="https://code.jquery.com/jquery-1.10.2.js"></script>

The problem with this version is that if I use it on my site it changes my css's from the site

In other words, my question is how can I use one of these versions that makes my script work and does not change my css styles.

My script:

<script src="https://code.jquery.com/jquery-1.4.1.js"></script><scripttype="text/javascript">
    function mudalinhas(idlinhas) {
        if (idlinhas == 5) {
            alert("ola");
        }
    }
</script>
    
asked by anonymous 22.05.2016 / 18:56

1 answer

0

Try using jQuery noConflict. The following is an example.

<script src="https://code.jquery.com/jquery-1.4.1.js"></script><scripttype="text/javascript">

    jQ = jQuery.noConflict();
    //Caso a sua classe styledselect_pages seja usada para instânciar algum plugin instâncie com o exemplo abaixo.

    jQ('.styledselect_pages').nome_do_plugin(); // jQ é usada para referenciar o jquery que você usou o noConflict;

    function mudalinhas(idlinhas) {
        if (idlinhas == 5) {
            alert("ola");
        }
    }
</script>
  

For more information link

    
23.05.2016 / 01:44