V
V
vvmgev2015-09-01 21:11:27
PHP
vvmgev, 2015-09-01 21:11:27

ajax not working in firefox?

Works fine in all browsers. Not in Firefox

$('#formFilter').on('change','#selectBrand',function(){
  var val = $('#selectBrand').val();
  var aaa = window.location.href
  aaa =  aaa.split("/")[2];
  aaa = 'http://'+aaa;
  $.ajax({
    url:aaa+"/admin/ajaxFilter",
    type:"POST",
    data: ({brand: val}),
    dataType:"json",
    success:function(data){
      $('#selectModel').html('<option value="">Выберите модель</option>')
      for (var i in data){
        $('#selectModel').append('<option value="'+data[i]+'">'+data[i]+'</option>')
      }
    }
  })

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pashenka, 2015-09-02
@like-a-boss

And what does he write?
data:must be an object, array or string

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question