2017-12-18 295 views
0

我需要使用使用Bootstrap的datepicker和jQuery對話框功能。要做到這一點,我用這些鏈接:同時使用datepicker和jQuery對話框功能

<link rel="stylesheet" href="resources/bootstrap.3.3.7/css/bootstrap.min.css"/> 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> 
    <script src="resources/bootstrap.3.3.7/js/bootstrap.min.js"></script> 


<link href="resources/css/font-awesome-4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" /> 
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> 
<script src="resources/jquery_ui/jquery-ui.min.js"></script> 

<link href="resources/css/tables.css" rel="stylesheet" type="text/css" /> 
<link href="resources/css/buttons.css" rel="stylesheet" type="text/css" /> 
<link href="resources/css/forms.css" rel="stylesheet" type="text/css" /> 
<link href="resources/css/style.css" rel="stylesheet" type="text/css" /> 

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


<!-- for the date --> 
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/css/datepicker.min.css" /> 
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/css/datepicker3.min.css" /> 

<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/js/bootstrap-datepicker.min.js"></script> 

在JSP主體:

$(function(){ 

    dialog_info = $("#dialog").dialog({ 
      autoOpen: false, 
      resizable: false, 
      height: "auto", 
      width: 300, 
      modal: true 

     }); 

    }); 

<div id="dialog" title="Caricamento pagina"> 
    <p><span class="ui-icon ui-icon-alert" style="float:left; margin:12px 12px 20px 0;"></span><span id="warn_message"></span></p> 
</div> 

我不能達到的結果使「Caricamento pagina」的對話框,使所以它隱藏在開始並顯示它,因爲$(function)中的代碼不起作用。我也試過:

$(document).ready(function() { 
    dialog_info = $("#dialog").dialog({ 
      autoOpen: false, 
      resizable: false, 
      height: "auto", 
      width: 300, 
      modal: true 

     }); 

    } 
) 

(應該是相同的),沒有結果。也許在上面的鏈接中存在兼容性問題?考慮到,在另一頁,在不需要日期選擇器,代碼工作與這些鏈接:

<link rel='stylesheet' href='webjars/bootstrap/3.2.0/css/bootstrap.min.css'>  
<script type="text/javascript" src="webjars/jquery/2.1.1/jquery.min.js"></script> 
<script type="text/javascript" src="webjars/bootstrap/3.2.0/js/bootstrap.min.js"></script> 
<link href="resources/css/tables.css" rel="stylesheet" type="text/css" /> 
<link href="resources/css/buttons.css" rel="stylesheet" type="text/css" /> 
<link href="resources/css/forms.css" rel="stylesheet" type="text/css" /> 
<link href="resources/css/style.css" rel="stylesheet" type="text/css" /> 
<link href="resources/css/font-awesome-4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" /> 
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> 
<script src="resources/jquery_ui/jquery-ui.min.js"></script> 

但在第一頁,我需要這麼日期選擇器顯示的鏈接以上是必要的。請幫忙。提前致謝。

+0

你在第一個代碼塊中兩次調用jQuery – disinfor

+0

固定格式和拼寫問題 – DiskJunky

回答

0

我解決了所有鏈接文件的問題,將它們放在本地文件夾中,並將jsp鏈接到本地​​。假設他們沒有在任何時候需要加載...