У меня есть следующий код, написанный, что необходимо сделать следующее: - Создание динамического сообщение с обратным отсчетом - Изменение цвета полосы прокрутки (использование # 20409a для цвета полосы прокрутки лица и # ffde20 для цвета полосы прокрутки) - использовать выбранный индекс в выберите тег для ссылки на новые веб-страниц - Добавить URL, уведомление об авторских правах, дату веб-странице Последнее изменениеJavascript не будет выполнять функции
Однако, когда я запускаю сайт, я получаю стандарт веб-страница, что я делаю неправильно или я пропустил. Спасибо за вашу помощь.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Unit 4 - A2</title>
<script type="text/javascript">
function countDown() {
var today = new Date() // Obtain current system date
var dayofweek = today.toLocaleString() // Convert date to a string that can be manipulated Day, Month Date, Year HH:MM:SS AM/PM
dayLocate = dayofweek.indexOf(" ") // Use indexOF() method to find the space between the month and day of the week to extract the month
weekDay = dayofweek.substring(0, dayLocate) // Use substring method to extract the day of the week from the string
newDay = dayofweek.substring(dayLocate) // Use substring to extract the remainder of the date from the strong
dateLocate = newDay.indexOf(",") //
monthDate = newDay.substring(0, dateLocate + 1)
yearLocate = dayofweek.indexOf("2015")
year = dayofweek.substr(yearLocate, 4)
var DateOfLaunch = new Date("July 31, 2015")
var daysToGo = DateOfLaunch.getTime()-today.getTime()
var daysToLaunch = Math.ceil(daysToGo/(1000*60*60*24))
}
function scrollColor() {
styleObject = document.getElementsByTagName('html')[0].style
styleObject.scrollbarFaceColor = "#20409a"
styleObject.scrollbarTrackColor = "#ffde20"
}
function loadInfo(myForm) {
var menuSelect = myForm.Menu.selectedIndex
var menuUrl = myForm.Menu.options[menuSelect].value + ".html"
window.location = menuUrl
}
funtion copyRight() {
var lastModDate = document.lastModified
var lastModDate = lastModDate.substring(0,10)
displayCopyRight.innerHTML = "<h6>The URL of this document is" + document.URL + "<br />Copyright Smart Homes System<br />This document was last modified " + lastModDate + ".</h6>"
}
</script>
<style type="text/css">
.center {
text-align: center;
}
table {
margin-left: 15%;
margin-right: 15%;
}
.cell-width {
width: 50%;
}
.left-align {
width: 50%;
left: 0px;
}
.right-align {
width: 50%;
right: 0px;
text-align: right;
}
.smallprint {
"Times New Roman", Times, serif;
font-weight: bold;
}
.textheadings {
font-weight: bold;
}
</style>
</head>
<body>
<div class="center">
<p><img src="banner-product.jpg" alt="Smart Homes, Inc banner"></p>
<p style="font-weight: bold;">About the Smart Homes System</p>
<img src="hrimg.gif" width="750px" height="5px" alt="hr line">
</div>
<div id=displayDate>
</div>
<table>
<tr>
<td colspan="2">
<p style="font-weight: bold;">The Smart Homes System</p>
<p>Smart Homes is an innovative home thermostat learns the usage patterns of its home's occupants over time and uses the data it collects to program itself to save money and energy. Additionally, the product allows owners to remotely control and program the thermostat via mobile computing devices such as Apple's iPhone and Google's Android.</p>
</td>
</tr>
<tr>
<td colspan="2">
<form id="announceMenu" action=" ">
<p style="font-weight: bolder;">Select an item from the list to see other current announcements:
<select name="Menu" onchange="loadInfo(this.form)">
<option>Select an item</option>
<option value="products">Products</option>
<option value="tickets">Prices</option>
<option value="listings">Features</option>
<option value="locations">Retail Locations</option>
</select>
</p>
</form>
</td>
</tr>
<tr>
<td colspan="2">
<p style="font-weight: bold;">Installation Guide</p>
<p>Smart Homes technology is easy to install! Detailed instruction.</p>
</td>
</tr>
<tr>
<td class="right-align">
<img src="image.jpg" alt="title" width="321px" height="160px">
</td>
<td class="left-align">
<img src="image2.jpg" alt="title" width="246px" height="161px">
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table>
<div id="displayCopyRight">
</div>
</body>
</html>
Вы проверили консоль браузера на наличие ошибок? – Pointy
Вы фактически не вызываете эти функции нигде. Где/когда/как вы ожидаете их исполнения? – David