2
CSS文件似乎正常加載。 JS文件似乎也加載,但它們都是無效的,沒有錯誤信息的CONSOL。Js文件加載不正確
我的文件是:該網站專用
<head>
<link rel="stylesheet" href="/static/libs/font-awesome4/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="/static/libs/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/static/css/style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="/static/js/script.js"></script>
<link rel="stylesheet" href="/_debug_toolbar/static/css/toolbar.css?0.7082793798424954" type="text/css">
</head>
唯一文件的script.js。的script.js低於短代碼:
$.fn.countdown = function (callback, duration, message) {
message = message || "";
var container = $(this[0]).html(duration + message);
var countdown = setInterval(function() {
if (--duration) {
container.html(duration + message);
} else {
clearInterval(countdown);
callback.call(container);
}
}, 1000);
};
// Use p.countdown as container, pass redirect, duration, and optional message
$(".countdown").countdown(submit_on_time, 30, "s remaining");
// Function to be called after 5 seconds
function submit_on_time() {
$('#interview-form').submit();
}
我有很難找到這個問題的根源。
看起來像你忘了'$(document).ready()' – adeneo