我試着讓這個腳本更新內容工作,但是我的引號根本沒有顯示出來。另外,我需要爲報價本身添加一些CCS。我需要幫助解決代碼拍攝問題。這是原始問題的鏈接,我以我實現它的方式附加代碼。獲取更新腳本以工作並添加樣式表
jQuery: update content every week (or long period of time)
更新content.html:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="quotes.js">
</head>
<body>
<div id="quotes-wrapper" class="quote-29">
<div class="quote">Testimonial Week 29</div>
<div class="author">Author</div>
</div>
<div id="quotes-wrapper" class="quote-30">
<div class="quote">Testimonial Week 30</div>
<div class="author">Author</div>
</div>
<div id="quotes-wrapper" class="quote-31">
<div class="quote">Testimonial Week 31</div>
<div class="author">Author</div>
</div>
</body>
quotes.js:這裏
Date.prototype.getWeek = function() {
var onejan = new Date(this.getFullYear(),0,1);
return Math.ceiling((((this - onejan)/86400000) + onejan.getDay()+1)/7);
}
$(function(){
var today = new Date();
var weekno = today.getWeek();
$('#quotes-wrapper').load('update-content.html div.quote-'+weekno);
});
謝謝,夥計們!我將通過這些建議,然後我會回覆該線程。 – icebot