Neo
Neo

Reputation: 117

Ajax doesn't work in firefox

this code doesn't work in firefox, in chrome it works and I'm getting results

console.log('send');
$.ajax({
  url: my_object.ajax_url,
  type: 'POST',
  data: {
    action: 'sendPhone',
    phone: '23342342',
    city: 'sddsfsf',
  },
  beforeSend: function(){
    console.log('beforeSend');
  },
  success: function(msg){
    console.log('result = '+msg);
    return;
  },
});//end $.ajax

output in chrome Chrome and this is output in firefox Firefox Who knows why $.Ajax doesn't work?

It something weird happening in our forest... :(

Upvotes: 1

Views: 102

Answers (1)

htshame
htshame

Reputation: 7330

Try this: `

console.log('send');
$.ajax({
  url: my_object.ajax_url,
  type: 'POST',
  data: {
    action: 'sendPhone',
    phone: '23342342',
    city: 'sddsfsf',
  },
  beforeSend: function(){
    console.log('beforeSend');
  }
  })
  .success(function(msg){
    console.log('result = ' + msg);
  });

`

Upvotes: 1

Related Questions