Guest User

Untitled

a guest
Aug 17th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. $.ajax({
  2. type: 'POST',
  3. url: 'http://dev.leed.steko.com.ua/api/takedata-promo',
  4. crossDomain: true,
  5. data: $(this).serialize(),
  6. dataType: 'json',
  7. success: function(data) {
  8. console.log(data)
  9. },
  10. error: function (responseData, textStatus, errorThrown) {
  11. alert('POST failed.');
  12. }
  13. });
  14.  
  15. header('Access-Control-Allow-Origin: '.$_SERVER['HTTP_ORIGIN']);
  16. header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');
  17. header('Access-Control-Max-Age: 1000');
  18. header('Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With');
Add Comment
Please, Sign In to add comment