По какой-то причине мои скрипты на мой взгляд перестали работать. Они работали раньше - к сожалению, я не помню, в какой момент они перестали работать, поэтому я не могу воспроизвести момент, когда он сломался. Однако могу точно сказать, что я вообще не менял сценарий. Вот мой взгляд:
@using errandomWeb.Models
@model errandomWeb.Models.errands
@{
ViewBag.Title = "Get It Done For You";
}
<div id = "postErrandContainer" class = "manageContainer">
<div id = "postErrandHeaderSection" class = "manageHeaderSection">
<h1 id = "postErrandHeaderTitle" class = "manageHeaderTitle">
@ViewBag.Title
</h1>
</div>
<section id = "postErrand" class = "manageForm">
@using (Html.BeginForm("PostErrandToDB", "errandom", FormMethod.Post, new { @id = "postErrandForm", @class = "form-horizontal", @role = "form" }))
{
@Html.AntiForgeryToken()
<!-- user activity tracking section -->
@Html.HiddenFor(m => m.LatitudePosted, new { @id = "postErrandLatitudePosted", @class = "userActivity" })
@Html.HiddenFor(m => m.LongitudePosted, new { @id = "postErrandLongitudePosted", @class = "userActivity" })
@Html.HiddenFor(m => m.LocationPosted, new { @id = "postErrandLocationPosted", @class = "userActivity" })
<!-- autopopulate errand values with current location -->
<script>
$(document).ready(function defaultPostValues() {
if (!navigator.geolocation) return;
navigator.geolocation.getCurrentPosition(function (userCoordinates) {
geocoder = new google.maps.Geocoder();
userLatLng = new google.maps.LatLng(userCoordinates.coords.latitude, userCoordinates.coords.longitude);
document.getElementById('postErrandLatitudePosted').value = userCoordinates.coords.latitude;
document.getElementById('postErrandLongitudePosted').value = userCoordinates.coords.longitude;
geocoder.geocode({ 'latLng': userLatLng }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var result = results[0];
locationPlaceholder = "";
for (var i = 0, len = result.address_components.length; i < len; i++) {
var addressComponent = result.address_components[i];
if (addressComponent.types.indexOf("locality") >= 0) locationPlaceholder = addressComponent.long_name;
}
if (locationPlaceholder != '') {
document.getElementById('postErrandLocationPosted').value = locationPlaceholder;
document.getElementById('postErrandLocationField').value = locationPlaceholder;
window.alert(locationPlaceholder);
}
}
});
});
</script>
<div id = "postErrandErrandSection" class = "manageSection">
<p id = "postErrandErrandSectionTitle" class = "manageSectionTitle">
errand
</p>
<div id = "postErrandPictureArea" class = "manageArea row">
@Html.LabelFor(m => m.Picture, new { @id = "postErrandPictureLabel", @class = "manageLabel col-xs-offset-1 col-xs-10 col-sm-offset-1 col-sm-10 col-md-offset-1 col-md-3 col-lg-offset-1 col-lg-4" })
<a id = "postErrandPictureSelectionButton" class = "manageField col-xs-offset-1 col-xs-10 col-sm-offset-1 col-sm-10 col-md-offset0 col-md-7 col-lg-offset-0 col-lg-6" href = "#">
select a file...
</a>
@Html.TextBoxFor(m => m.Picture, new { @id = "postErrandPictureField", @class = "manageField col-xs-offset-1 col-xs-10 col-sm-offset-1 col-sm-10 col-md-offset-0 col-md-7 col-lg-offset-0 col-lg-6", @type = "file", @style = "display: none" })
</div>
<hr />
<!-- customization of picture selection button -->
<script>
jQuery("#postErrandPictureSelectionButton").click(function () {
$("#postErrandPictureField").click();
$("#postErrandCroppingArea").show();
});
</script>
<script>
$("#postErrandPictureField").change(function () {
var fullFileName = $("#postErrandPictureField").val()
$("#postErrandPictureSelectionButton").html(fullFileName.substr(fullFileName.lastIndexOf('\\') + 1));
});
</script>
<div id = "postErrandCroppingArea" class = "manageArea row" style = "display: none">
<img id = "postErrandOriginal" class = "postErrandImage" src = "" alt = "" style = "display: none" />
<canvas id = "postErrandCropped" class = "postErrandImage" height = "5" width = "5"></canvas>
<input id = "postErrandButtonCrop" class = "manageButton col-xs-offset-1 col-xs-10 col-sm-offset-1 col-sm-10 col-md-offset-1 col-md-10 col-lg-offset-1 col-lg-10" type = "button" value = "Crop" />
<input id = "postErrandCropX" class = "postErrandData" name = "postErrandCropX" type = "hidden" />
<input id = "postErrandCropY" class = "postErrandData" name = "postErrandCropY" type = "hidden" />
<input id = "postErrandCropW" class = "postErrandData" name = "postErrandCropW" type = "hidden" />
<input id = "postErrandCropH" class = "postErrandData" name = "postErrandCropH" type = "hidden" />
<input id = "postErrandCroppedPicture" class = "postErrandData" name = "postErrandCroppedPicture" type = "hidden" />
</div>
<div id = "postErrandLocationArea" class = "manageArea row">
@Html.LabelFor(m => m.Location, new { @id = "postErrandLocationLabel", @class = "manageLabel col-xs-offset-1 col-xs-10 col-sm-offset-1 col-sm-10 col-md-offset-1 col-md-3 col-lg-offset-1 col-lg-4" })
@Html.TextBoxFor(m => m.Location, new { @id = "postErrandLocationField", @class = "manageField col-xs-offset-1 col-xs-10 col-sm-offset-1 col-sm-10 col-md-offset-0 col-md-7 col-lg-offset-0 col-lg-6", @placeholder = "location" })
@Html.ValidationMessageFor(m => m.Location, "", new { @id = "postErrandLocationValidation", @class = "manageValidation col-xs-offset-1 col-xs-10 col-sm-offset-1 col-sm-10 col-md-offset-4 col-md-7 col-lg-offset-5 col-lg-6" })
</div>
<!-- place autocomplete for Location -->
<script>
new google.maps.places.Autocomplete((document.getElementById('postErrandLocationField')), { types: ['geocode'] });
</script>
<hr />
<!-- time autocomplete for StartDateTime -->
<script>
$(document).ready(function defaultStartDateTime() {
startDateTime = new Date();
var h = startDateTime.getHours() + 1;
if (h > 23) {
h = "00"
}
else {
if (h < 10) {
h = "0" + h
}
}
var d = startDateTime.getDate();
if (d < 10) {
d = "0" + d
}
var m = startDateTime.getMonth() + 1;
if (m < 10) {
m = "0" + m
}
var y = startDateTime.getFullYear();
placeholderStartDateTime = "";
placeholderStartDateTime = m + "/" + d + "/" + y + " " + h + ":00";
if (placeholderStartDateTime != '') {
document.getElementById('postErrandStartDateTimeField').value = placeholderStartDateTime;
};
})
</script>
<div id = "postErrandStartDateTimeArea" class = "postErrandArea row">
@Html.LabelFor(m => m.StartDateTime, new { @id = "postErrandStartDateTimeLabel", @class = "manageLabel col-xs-offset-1 col-xs-5 col-sm-offset-1 col-sm-5 col-md-offset-1 col-md-5 col-lg-offset-1 col-lg-5" })
@Html.LabelFor(m => m.ASAP, new { @id = "postErrandASAPLabel", @class = "manageLabel col-xs-5 col-sm-5 col-md-5 col-lg-5" })
@Html.TextBoxFor(m => m.StartDateTime, new { @id = "postErrandStartDateTimeField", @class = "manageField col-xs-offset-1 col-xs-6 col-sm-offset-1 col-sm-4 col-md-offset-5 col-md-3 col-lg-offset-5 col-lg-3", @onblur = "document.getElementById('postErrandEndDateTimeField').value = document.getElementById('postErrandStartDateTimeField').value;" })
@Html.HiddenFor(m => m.StartDateTime, new { @id = "postErrandStartDateTimeHiddenField", @class = "manageField col-xs-offset-1 col-xs-10 col-sm-offset-1 col-sm-10 col-md-offset-0 col-md-7 col-lg-offset-0 col-lg-6" })
<div id = "postErrandASAPBuffer" class = "postErrandBuffer col-xs-3 col-sm-5 col-md-2 col-lg-2"></div>
@Html.CheckBoxFor(m => m.ASAP, new { @id = "postErrandASAPField", @class = "manageField col-xs-1 col-sm-1 col-md-1 col-lg-1", @onclick = "document.getElementById('postErrandStartDateTimeHiddenField').value = placeholderStartDateTime; document.getElementById('postErrandStartDateTimeField').disabled=this.checked;" })
@Html.ValidationMessageFor(m => m.StartDateTime, "", new { @id = "postErrandStartDateTimeValidation", @class = "manageValidation col-xs-offset-1 col-xs-6 col-sm-offset-1 col-sm-4 col-md-offset-5 col-md-3 col-lg-offset-5 col-lg-3" })
</div>
<div id = "postErrandEndDateTimeArea" class = "postErrandArea row">
@Html.LabelFor(m => m.EndDateTime, new { @id = "postErrandEndDateTimeLabel", @class = "manageLabel col-xs-offset-1 col-xs-5 col-sm-offset-1 col-sm-5 col-md-offset-1 col-md-5 col-lg-offset-1 col-lg-5" })
@Html.LabelFor(m => m.DurationInHours, new { @id = "postErrandDurationInHoursLabel", @class = "manageLabel col-xs-5 col-sm-5 col-md-5 col-lg-5" })
@Html.TextBoxFor(m => m.EndDateTime, new { @id = "postErrandEndDateTimeField", @class = "manageField col-xs-offset-1 col-xs-6 col-sm-offset-1 col-sm-4 col-md-offset-5 col-md-3 col-lg-offset-5 col-lg-3" })
<div id = "postErrandDurationInHoursBuffer" class = "postErrandBuffer col-xs-1 col-sm-4 col-md-1 col-lg-1"></div>
@Html.TextBoxFor(m => m.DurationInHours, new { @id = "postErrandDurationInHoursField", @class = "manageField col-xs-3 col-sm-2 col-md-2 col-lg-2" })
@Html.ValidationMessageFor(m => m.EndDateTime, "", new { @id = "postErrandEndDateTimeValidation", @class = "manageValidation col-xs-offset-1 col-xs-10 col-sm-offset-1 col-sm-10 col-md-offset-4 col-md-7 col-lg-offset-5 col-lg-6" })
@Html.ValidationMessageFor(m => m.DurationInHours, "", new { @id = "postErrandDurationInHoursValidation", @class = "manageValidation col-xs-offset-1 col-xs-10 col-sm-offset-1 col-sm-10 col-md-offset-4 col-md-7 col-lg-offset-5 col-lg-6" })
</div>
<hr />
<div id = "postErrandOfferingArea" class = "postErrandArea row">
@Html.LabelFor(m => m.Currency, new { @id = "postErrandCurrencyLabel", @class = "manageLabel col-xs-offset-1 col-xs-4 col-sm-offset-1 col-sm-4 hidden-md hidden-lg" })
@Html.LabelFor(m => m.Offering, new { @id = "postErrandOfferingLabel", @class = "manageLabel col-xs-offset-0 col-xs-3 col-sm-offset-0 col-sm-3 col-md-offset-1 col-md-3 col-lg-offset-1 col-lg-4" })
@Html.DropDownListFor(Currencies => Currencies.Currency, new SelectList(ViewBag.currency as List<SelectListItem>, "Value", "Text"), "-select-", new { @id = "postErrandCurrencyField", @class = "manageField col-xs-offset-1 col-xs-4 col-sm-offset-1 col-sm-4 col-md-offset-0 col-md-3 col-lg-offset-0 col-lg-2" })
@Html.TextBoxFor(m => m.Offering, new { @id = "postErrandOfferingField", @class = "manageField col-xs-offset-0 col-xs-6 col-sm-offset-0 col-sm-6 col-md-offset-0 col-md-4 col-lg-offset-0 col-lg-4", @placeholder = "$$$" })
@Html.ValidationMessageFor(m => m.Currency, "", new { @id = "postErrandCurrencyValidation", @class = "manageValidation col-xs-offset-1 col-xs-10 col-sm-offset-1 col-sm-10 col-md-offset-4 col-md-7 col-lg-offset-5 col-lg-6" })
@Html.ValidationMessageFor(m => m.Offering, "", new { @id = "postErrandOfferingValidation", @class = "manageValidation col-xs-offset-1 col-xs-10 col-sm-offset-1 col-sm-10 col-md-offset-4 col-md-7 col-lg-offset-5 col-lg-6" })
</div>
<div id = "postErrandPriceArea" class = "postErrandArea row">
@Html.HiddenFor(m => m.errandTax, new { @id = "postErrandTaxField", @class = "postErrandTaxField" })
@Html.LabelFor(m => m.Price, new { @id = "postErrandPriceLabel", @class = "manageLabel col-xs-offset-1 col-xs-10 col-sm-offset-1 col-sm-10 col-md-offset-1 col-md-3 col-lg-offset-1 col-lg-4" })
@Html.TextBoxFor(m => m.Price, new { @id = "postErrandPriceField", @class = "manageField col-xs-offset-1 col-xs-10 col-sm-offset-1 col-sm-10 col-md-offset-0 col-md-7 col-lg-offset-0 col-lg-6", @disabled = true })
@Html.HiddenFor(m => m.Price, new { @id = "postErrandPriceHiddenField", @class = "manageField col-xs-offset-1 col-xs-10 col-sm-offset-1 col-sm-10 col-md-offset-0 col-md-7 col-lg-offset-0 col-lg-6" })
</div>
<!-- calculate errand tax -->
<script>
document.getElementById('postErrandOfferingField').onchange = function () { calculateErrandTax() };
function calculateErrandTax() {
var offering = document.getElementById('postErrandOfferingField').value;
var userRating = document.getElementById('postErrandUserRating').value;
var currency = document.getElementById('postErrandCurrencyField').value;
if (offering < 50) {
if (userRating > 5 * 0.95) {
var price = (offering * 1.12);
document.getElementById('postErrandTaxField').value = 0.12;
document.getElementById('postErrandPriceField').value = currency + " " + price.toFixed(2);
document.getElementById('postErrandPriceHiddenField').value = currency + " " + price.toFixed(2);
}
else {
var price = offering * 1.15;
document.getElementById('postErrandTaxField').value = 0.15;
document.getElementById('postErrandPriceField').value = currency + " " + price.toFixed(2);
document.getElementById('postErrandPriceHiddenField').value = currency + " " + price.toFixed(2);
}
}
else if (offering < 100) {
if (userRating > 5 * 0.95) {
var price = offering * 1.10;
document.getElementById('postErrandTaxField').value = 0.10;
document.getElementById('postErrandPriceField').value = currency + " " + price.toFixed(2);
document.getElementById('postErrandPriceHiddenField').value = currency + " " + price.toFixed(2);
}
else {
var price = offering * 1.12;
document.getElementById('postErrandTaxField').value = 0.12;
document.getElementById('postErrandPriceField').value = currency + " " + price.toFixed(2);
document.getElementById('postErrandPriceHiddenField').value = currency + " " + price.toFixed(2);
}
}
else if (offering < 500) {
if (userRating > 5 * 0.95) {
var price = offering * 1.07;
document.getElementById('postErrandTaxField').value = 0.07;
document.getElementById('postErrandPriceField').value = currency + " " + price.toFixed(2);
document.getElementById('postErrandPriceHiddenField').value = currency + " " + price.toFixed(2);
}
else {
var price = offering * 1.10;
document.getElementById('postErrandTaxField').value = 0.10;
document.getElementById('postErrandPriceField').value = currency + " " + price.toFixed(2);
document.getElementById('postErrandPriceHiddenField').value = currency + " " + price.toFixed(2);
}
}
else if (offering >= 500) {
if (userRating > 5 * 0.95) {
var price = offering * 1.05;
document.getElementById('postErrandTaxField').value = 0.05;
document.getElementById('postErrandPriceField').value = currency + " " + price.toFixed(2);
document.getElementById('postErrandPriceHiddenField').value = currency + " " + price.toFixed(2);
}
else {
var price = offering * 1.07;
document.getElementById('postErrandTaxField').value = 0.07;
document.getElementById('postErrandPriceField').value = currency + " " + price.toFixed(2);
document.getElementById('postErrandPriceHiddenField').value = currency + " " + price.toFixed(2);
}
}
};
</script>
</div>
<div id = "postErrandButtonSection" class = "manageSection">
<div id = "postErrandButtonArea" class = "manageArea row">
<button id = "postErrandButton" class = "manageButton col-xs-offset-1 col-xs-10 col-sm-offset-1 col-sm-10 col-md-offset-1 col-md-10 col-lg-offset-1 col-lg-10" type = "submit">
Submit
</button>
</div>
</div>
}
</section>
<div id = "postErrandReturnToMenuSection" class = "manageReturnToMenuSection">
@Html.ActionLink("Return to Menu", "Index", "", htmlAttributes: new { @id = "postErrandReturnToMenuButton", @class = "manageReturnToMenuButton" })
</div>
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
<!-- jCrop script -->
<script type = "text/javascript" src = "https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type = "text/javascript" src = "https://cdn.rawgit.com/tapmodo/Jcrop/master/js/jquery.Jcrop.min.js"></script>
<script type = "text/javascript">
$(function () {
if ($('#postErrandCroppingArea').width() > 500) {
$('#postErrandPictureField').change(function () {
$('#postErrandOriginal').hide();
var reader = new FileReader();
reader.onload = function (e) {
$('#postErrandOriginal').show();
$('#postErrandOriginal').attr("src", e.target.result);
$('#postErrandOriginal').Jcrop({
onChange: SetCoordinates,
onSelect: SetCoordinates,
aspectRatio: 1,
boxWidth: 450,
addClass: 'postErrandCropping'
});
}
reader.readAsDataURL($(this)[0].files[0]);
});
}
else {
$('#postErrandPictureField').change(function () {
$('#postErrandOriginal').hide();
var reader = new FileReader();
reader.onload = function (e) {
$('#postErrandOriginal').show();
$('#postErrandOriginal').attr("src", e.target.result);
$('#postErrandOriginal').Jcrop({
onChange: SetCoordinates,
onSelect: SetCoordinates,
aspectRatio: 1,
boxWidth: 250,
addClass: 'postErrandCropping'
});
}
reader.readAsDataURL($(this)[0].files[0]);
});
}
$('#postErrandButtonCrop').click(function () {
var x1 = $('#postErrandCropX').val();
var y1 = $('#postErrandCropY').val();
var height = $('#postErrandCropH').val();
var width = $('#postErrandCropW').val();
var canvas = $("#postErrandCropped")[0];
var context = canvas.getContext('2d');
var img = new Image();
img.onload = function () {
canvas.height = height;
canvas.width = width;
context.drawImage(img, x1, y1, width, height, 0, 0, width, height);
var image = canvas.toDataURL().replace(/^data:image/[a-z]+;base64,/, "");
$('#postErrandCroppedPicture').val(image);
//$('#postErrandButtonUpload').show();
$('#postErrandCropped').hide();
$('#postErrandButtonCrop').hide();
};
img.src = $('#postErrandOriginal').attr("src");
});
});
function SetCoordinates(c) {
$('#postErrandCropX').val(c.x);
$('#postErrandCropY').val(c.y);
$('#postErrandCropW').val(c.w);
$('#postErrandCropH').val(c.h);
$('#postErrandButtonCrop').show();
};
</script>
<!-- pulling in Google Places library -->
<script src = "https://maps.googleapis.com/maps/api/js?key=AIzaSyDQXVljq4LT-imCbZkOcC7_IiwcECEm0cc&libraries=places"></script>
<!-- pulling in DateTimePicker -->
<script src = "~/Scripts/jquery.datetimepicker.full.min.js"></script>
<script>
jQuery('#postErrandStartDateTimeField').datetimepicker({
format: 'm/d/Y H:i',
step: '30',
minDate: 0,
defaultDate: 0,
defaultTime: 0,
yearStart: 2017,
yearEnd: 2030,
});
</script>
<script>
jQuery('#postErrandEndDateTimeField').datetimepicker({
format: 'm/d/Y H:i',
step: '30',
minDate: 0,
defaultDate: 0,
defaultTime: 0,
yearStart: 2017,
yearEnd: 2030,
});
</script>
}
Странно также то, что он не является специфическим для отдельного скрипта, а скорее влияет на все из них, за исключением jCrop, Google Places Lirbary и DateTimePicker (все они объявлены в моем коде).
Ниже показано, что я получаю от консоли, но не знаю, что с этим делать ...
SCRIPT5022: SCRIPT5022: Bootstrap's JavaScript requires jQuery
bootstrap.min.js (6,31)
SCRIPT5007: SCRIPT5007: Unable to get property 'concat' of undefined or null reference
jquery.mobile.min.js (4,5765)
SEC7111: HTTPS security is compromised by http://jcrop-cdn.tapmodo.com/v2.0.0-RC1/js/Jcrop.js
localhost:44356 (1,1)
2 SEC7111: HTTPS security is compromised by http://jcrop-cdn.tapmodo.com/v2.0.0-RC1/css/Jcrop.css
localhost:44356 (1,1)
SCRIPT5022: SCRIPT5022: Bootstrap's JavaScript requires jQuery
bootstrap.min.js (6,31)
SCRIPT5007: SCRIPT5007: Unable to get property 'concat' of undefined or null reference
jquery.mobile.min.js (4,5765)
SEC7111: HTTPS security is compromised by http://jcrop-cdn.tapmodo.com/v2.0.0-RC1/js/Jcrop.js
PostErrand (1,1)
2 SEC7111: HTTPS security is compromised by http://jcrop-cdn.tapmodo.com/v2.0.0-RC1/css/Jcrop.css
PostErrand (1,1)
SCRIPT1009: SCRIPT1009: Expected '}'
PostErrand (233,13)
You have included the Google Maps API multiple times on this page. This may cause unexpected errors.
14 SCRIPT5: SCRIPT5: Access is denied.
PostErrand (1,1)
5 SCRIPT5: Access is denied.
common.js (22,123)
Неа - я новичок, поэтому даже не знал бы, как там добраться до ошибки? Он просто не реагирует / не выполняет свою работу.
Нажимаем F12 и заглядываем в консоль. Почти наверняка там что-нибудь будет. В противном случае на этот вопрос нет ответа.
ОК - добавил. Спасибо!
Хорошо, это много ошибок. Теперь вам нужно выяснить, что каждый из них означает - здесь слишком много для вопроса.
"JavaScript для начальной загрузки требует jQuery" ... звучит так, как будто вы включили какой-то сценарий начальной загрузки до того, как включили jQuery. Порядок включения скриптов важен, так как одни полагаются на другие. Также кажется, что вы включили некоторые из них дважды (карты Google предупреждают вас об этом), у вас могут быть синтаксические ошибки в других, а некоторые загружаются через небезопасный HTTP. Это сводка этих ошибок. Проработайте их один за другим. Поскольку в большинстве случаев мы не видим, как и где вы загружаете скрипты, нам трудно помочь. Остальная часть этой стены кода, которую вы показали, вероятно, не имеет значения, если она также не содержит синтаксических ошибок.
убедитесь, что вы включили jquery в первую очередь



![Безумие обратных вызовов в javascript [JS]](https://i.imgur.com/WsjO6zJb.png)


Хорошо - это было множество причин, но вы показываете мне, как понять, что происходит, уже очень помогли мне, так что спасибо.
<!-- autopopulate errand values with current location -->
<script>
$(document).ready(function defaultPostValues() {
if (!navigator.geolocation) return;
navigator.geolocation.getCurrentPosition(function (userCoordinates) {
geocoder = new google.maps.Geocoder();
userLatLng = new google.maps.LatLng(userCoordinates.coords.latitude, userCoordinates.coords.longitude);
document.getElementById('postErrandLatitudePosted').value = userCoordinates.coords.latitude;
document.getElementById('postErrandLongitudePosted').value = userCoordinates.coords.longitude;
geocoder.geocode({ 'latLng': userLatLng }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var result = results[0];
locationPlaceholder = "";
for (var i = 0, len = result.address_components.length; i < len; i++) {
var addressComponent = result.address_components[i];
if (addressComponent.types.indexOf("locality") >= 0) locationPlaceholder = addressComponent.long_name;
}
if (locationPlaceholder != '') {
document.getElementById('postErrandLocationPosted').value = locationPlaceholder;
document.getElementById('postErrandLocationField').value = locationPlaceholder;
}
}
});
});
Здесь мне просто не хватало последнего
});
</script>
У вас есть ошибка в консоли вашего браузера? Сказать, что они «не работают», совершенно бесполезно.