4
當運行小的HTML文件下面我看到下面的控制檯日誌錯誤:Moment.js:遺漏的類型錯誤:無法在moment.js讀取未定義的屬性 'defineLocale':13
moment.js:13 Uncaught TypeError: Cannot read property 'defineLocale' of undefined
at moment.js:13
at moment.js:9
at moment.js:10
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="../scripts/libraries/moment.js"></script>
</head>
<body>
<script>
var now = moment()
console.log(now);
</script>
</body>
</html>
我也試圖與該CDN鏈接替換參照當地圖書館:https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/locale/af.js
任何硝酸鉀這個錯誤是什麼?
如果它是不正確的路徑,OP會得到一個「時刻未定義「錯誤 –
謝謝,我編輯了答案 – luisenrike
這解決了它,謝謝 –