简体   繁体   中英

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铬合金 and this is output in firefox火狐 Who knows why $.Ajax doesn't work?

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

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);
  });

`

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM