Помогите разобраться с JVS
Получаю ошибку jquery.min.js:2 GET net::ERR_FAILED
<input type="hidden" name="af_action" >
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$("#phone-button").click(function() {
phone = document.getElementById('phone_phone').value
name = document.getElementById('name_name').value
document.getElementById('phone-button').innerHTML = 'Отправляется...'
$.get("https://taxigreenline.ru/phone/", {name:name, phone:phone})
.done(function (data) {
document.location.href = "https://taxigreenline.ru/yes/";
});
});
$('#popup_bg, #popphone, #popup').hide("normal");
$('#tel').click(function(){
$('#popup_bg, #popphone, #popup').show("normal");
})
$('#ghil').click(function(){
$('#popup_bg, #popphone, #popup').show("normal");
})
$('.p_close').click(function(){
$('#popup_bg, #popphone, #popup').hide("normal");
})
Ответы (1 шт):
Автор решения: ryzen
→ Ссылка
Вы не объявляете переменные, а обращаетесь к существующим, которых по всей видимости нет.
$("#phone-button").click(function() {
const phone = document.getElementById('phone_phone').value
const name = document.getElementById('name_name').value
document.getElementById('phone-button').innerHTML = 'Отправляется...'
$.get("https://taxigreenline.ru/phone/", {name, phone})
.done(function (data) {
document.location.href = "https://taxigreenline.ru/yes/";
});
});