Не работает обратная связь ( обратный звонок )
Ошибки Uncaught TypeError: phone is not a function at HTMLButtonElement.onclick (VM2760:1353)
Access to XMLHttpRequest at 'https://taxigreenline.ru/phone/?name=%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80&phone=%2B79854780404' from origin 'http://www.taxigreenline.ru' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. taxigreenline.ru/phone/?name=%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80&phone=%2B79854780404:1 Failed to load resource: net::ERR_FAILED icon-bars.png:1 Failed to load resource: the server responded with a status of 404 (Not Found)
Скидываю снизу как написано. Помогите исправить
<h4>Заказать звонок</h4>
</div>
<div class="ajax_form" id="clback">
<div class="field">
<input id='name_name' type="text" name="name" required="">
<label for="phone_phone">Ваше имя</label>
</div>
<div class="field">
<input type="tel" id="phone_phone" name="phone" required="">
<label for="phone_phone">Телефон</label>
</div>
</div>
<button onclick="phone()" id='phone-button' class="submit ">Заказать обратный звонок</button>
<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");
})
</script>
</body>
</html>