2014-12-03 107 views
1

我正在使用JQuery UI Date Picker。JQUERY UI DatePicker日曆不顯示

之前工作很好,但現在的日曆不會顯示出來。 有什麼想法?

這是我的代碼。 http://pastebin.com/L4j2TmyY

我的代碼太長,所以我把它放在pastebin中。

我遵循這個確切,但日曆未顯示 http://jqueryui.com/datepicker/

+1

您正在使用datepick() 正確的方法是datepicker() – 2014-12-03 10:18:13

+0

是的。我已經將它更改爲datepicker(),但仍然不顯示。 – 2014-12-03 10:24:19

+0

檢查控制檯(F12)並查看它說的是什麼。 – fritsMaister 2014-12-03 10:45:57

回答

1

我想你應該下載所有的JavaScript文件到你的項目文件夾,並調用JavaScript文件。

例子:

從外部URL調用JavaScript的(不工作)

<!doctype html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <title>undelegate demo</title> 
    <style> 
    button { 
    margin: 5px; 
    } 
    button#theone { 
    color: red; 
    background: yellow; 
    } 
    </style> 
    <script src="//code.jquery.com/jquery-1.10.2.js"></script> 
</head> 
<body> 

<button id="theone">Does nothing...</button> 
<button id="bind">Bind Click</button> 
<button id="unbind">Unbind Click</button> 
<div style="display:none;">Click!</div> 

<script> 
function aClick() { 
    $("div").show().fadeOut("slow"); 
} 
$("#bind").click(function() { 
    $("body") 
    .delegate("#theone", "click", aClick) 
    .find("#theone").text("Can Click!"); 
}); 
$("#unbind").click(function() { 
    $("body") 
    .undelegate("#theone", "click", aClick) 
    .find("#theone").text("Does nothing..."); 
}); 
</script> 

</body> 
</html> 

從項目文件夾調用(做工精細)

<!doctype html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <title>undelegate demo</title> 
    <style> 
    button { 
    margin: 5px; 
    } 
    button#theone { 
    color: red; 
    background: yellow; 
    } 
    </style> 
    <script src="jQuery.js"></script> 
</head> 
<body> 

<button id="theone">Does nothing...</button> 
<button id="bind">Bind Click</button> 
<button id="unbind">Unbind Click</button> 
<div style="display:none;">Click!</div> 

<script> 
function aClick() { 
    $("div").show().fadeOut("slow"); 
} 
$("#bind").click(function() { 
    $("body") 
    .delegate("#theone", "click", aClick) 
    .find("#theone").text("Can Click!"); 
}); 
$("#unbind").click(function() { 
    $("body") 
    .undelegate("#theone", "click", aClick) 
    .find("#theone").text("Does nothing..."); 
}); 
</script> 

</body> 
</html> 
1

,因爲我看到你的引擎收錄你同時加載兩個jQuery的圖書館,這是不推薦的,但可以用jQuery.noConflict()使用它。所以速戰速決是這樣的:

刪除這個庫:

<script src="//code.jquery.com/jquery-1.10.2.js"></script> 
+0

這也不工作..我一直在爲此工作近8小時..我無法找到錯誤的位置是。 – 2014-12-03 10:26:49

+0

@KimCarlo您可以檢出瀏覽器控制檯中可用的任何js錯誤。 – Jai 2014-12-03 10:31:36

+0

這裏是控制檯的屏幕截圖 https://drive.google.com/file/d/0BwkoZTNT2pYwb0lUMGJ1dkZZUmM/view?usp=sharing – 2014-12-03 10:43:16

1

@Kim卡羅

我繼續@Rohit Bandooni的回答。

作爲他的回答,它應該正常工作。

從糊克隆了引擎收錄:http://pastebin.com/2yNiXy44 我做了一些變化: - 評你2「模具」 - (在引擎收錄搜索文本「CHANGE_BY_ME」)更改方法名

我上運行我的EasyPHP,它運作良好:http://imgur.com/kfmLkLY,lHsEUyv(2個控件的圖像) 我在您的頁面上只找到2個日期控件。