2016-10-23 6 views
-1

エラー:TypeError:$(...)。calendarは関数ではありません。このエラーは何を象徴するのでしょうか?

jQueryのスクリプト

$('#dates').calendar({ 
         type: 'date' 
        }); 

形で使用(#dates) ID:コード(下)

<div class="ui calendar" id="dates"> 
<div class="ui input left icon"> 
<i class="calendar icon"></i> 
<input type="date" placeholder="Date" name="rprt_date" required title="Date is Required"> 
</div> 
</div> 
+0

私はあなたのjQueryをロードした後、カレンダープラグインをロードしていないことを意味します。 –

+0

'calendar'は[jQuery API](http://api.jquery.com)の一部ではありません。そのコードは、それを供給するプラグインに依存しています。 –

答えて

0

は、このコードスニペットかもしれませが は、具体的に見て役立つだろう$("#datepicker").datepicker(); ここでは、jQueryのdatepickerライブラリをロードしています。

<!doctype html> 
 
<html lang="en"> 
 
<head> 
 
    <meta charset="utf-8"> 
 
    <title>datepicker demo</title> 
 
    <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css"> 
 
    <script src="//code.jquery.com/jquery-1.12.4.js"></script> 
 
    <script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script> 
 
</head> 
 
<body> 
 
    
 
<div id="datepicker"></div> 
 
    
 
<script> 
 
$("#datepicker").datepicker(); 
 
</script> 
 
    
 
</body> 
 
</html>

関連する問題