A
A
Alexander Zaitsev2018-09-04 03:34:11
JavaScript
Alexander Zaitsev, 2018-09-04 03:34:11

Ajax form not submitting data to the server, why?

There is a site, on the site a form from one field phone and hidden fields with other values, when sending (pressing a button), the data is sent to phpmail'om and to the server at a different address and the response "successful / unsuccessful" is returned. Everything works, except for sending to another server. Code: pozitive-tlt.ru/mail.js
Chrome does not give any errors, everything seems to be ok, but it does not work.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrew, 2018-09-04
@AndreuChel

CORS is a modern browser technology that allows a web page to access resources from another domain.
On the server (PHP) should be:
<?php
header("Access-Control-Allow-Origin: example.com ");
?>

T
ThunderCat, 2018-09-04
@ThunderCat

Everything works, except for sending to another server.
Cross Domain Policy?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question