There is a data entry form where you need to enter a URL for something to happen. Form data is sent via Ajax-POST to the PHP handler. The handler itself does not issue an error when switching to it. Here is the Ajax code itself:

 function call() { var msg = $('#send').serialize(); $.ajax({ type: 'POST', url: '/oauth/v1/logup', data: msg, success: function(data) { $('#_data').html(data); }, error: function(xhr, str){ alert('Возникла ошибка: ' + xhr.responseCode); } }); } 

When I send a request from a form, for example, I entered the value of site.ru , then the address is successfully passed to the handler, but if http://site.ru , then an undefined error occurs. What could be the problem?

  • jQuery library is not loaded into the page - Igor
  • @Igor is connected. If you simply enter site.ru into the form, then everything is sent, but with http://site.ru already an error - Dmitry Frolov
  • provide the full text of the error - Igor
  • @Igor undefined. Such a mistake. - Dmitry Frolov
  • console.log(xhr); -? - Igor

0