Problems with the SRC in an HTML page

0

Trying my application I've noticed that in firefox - mozilla the input type='date' do not work, looking a bit in the network I found a solution with datepicker that on a test page works great!

My problem is that in several pages I must have access to export in excel and when I put all the src generates some type of conflict that does not allow either of the two .. the one that is below ..

How can I solve this?
This is the code that generates conflict:

<meta charset="utf-8">
        <!--  Librerias para datepicker  -->          
          <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" />
          <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
          <script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
          <script src="JS/datepicker.js" type="text/javascript"></script>

        <!--Exportar Excel-->       
          <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
          <script src="JS/exportarExcel.js" type="text/javascript"></script>

I understand the issue of the jquery versions, but if I put the most recent one, none of the 2 ... what can I do?

EDITION

When I open the code to see what problem is presented, it shows me this,

  
    

TypeError: $ (...). datepicker is not a function [Learn more] datepicker.js: 8: 11     The use of getPreventDefault () is disapproved. Use defaultPrevented instead. jquery-1.9.1.js: 3346: 28     

  

These warnings vary if I remove any of the 2 src .. or the datepicker or the export excel.

EDIT 2

this is the code of datePicker.jsp

$(document).ready(function() {
var es_firefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;

          if (es_firefox ) {
          $(document).ready(function () {
          $("#datePicker").datepicker({ dateFormat: 'yy-mm-dd' }).val();
          $("#datePicker2").datepicker({ dateFormat: 'yy-mm-dd' }).val();
          });
          }
});
    
asked by Andres Felipe Diaz 17.05.2017 в 14:43
source

2 answers

1

Indeed, the problem is presented by incompatibility of versions.

The solution is to upload the version of datePicker de 1.9 -> 1.10 so that it does not generate problems.

<title>Reportes Equipo</title>
    <meta charset="utf-8">
        <!--Librerias para Exportar --> 
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
        <script src="JS/exportarExcel.js" type="text/javascript"></script>

          <!--Librerias para datepicker-->            
          <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" />
          <script src="http://code.jquery.com/jquery-1.11.1.js"></script>
          <script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
          <script src="JS/datepicker.js" type="text/javascript"></script>
    
answered by 18.05.2017 в 16:37
0

Maybe your problem comes from what you are doing

$(document).ready(function() {
   $("#datePicker").datepicker({
     dateFormat: 'yy-mm-dd'
}).val();

You are invoking the .val() method before the component initialization. Try removing the .val() of both datepickers.

EDITING

Regarding the duplicate versions of jquery, keep the most current, and keep in mind, that the declaration of the files js must be in a logical order, that is, first import the libraries of jquery , then the jquery-ui and finally your own.

    
answered by 17.05.2017 в 15:17