S
S
Stanislav Kim2014-06-04 21:55:53
JavaScript
Stanislav Kim, 2014-06-04 21:55:53

ajax button not working in firefox

Website kstlife.kz/say
Ajax form submit button. Works fine in all browsers. Firefox doesn't. What could be the problem?

$('document').ready(function () {
  $('#loading').on("click",function () {
    event.preventDefault();
    var ids = $("textarea[name='text']").val();
    var name= $("input[name='name']").val();
    var btn = $(this);btn.button('loading');
    $.ajax({
                    url: "say/add",
                    cache: false,
                    data: { text: ids, name:name },
                    type: "POST",
                    success: function(html) { $('#say').html(html);}
    }).always(function () {
      btn.button('reset')
    });
     return false;
  });
    });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IceJOKER, 2014-06-04
@cyberS7

Forgot to pass event itself to function(){} .
try

$('document').ready(function () {
  $('#loading').on("click",function (event) {
    event.preventDefault();
    var ids = $("textarea[name='text']").val();
    var name= $("input[name='name']").val();
    var btn = $(this);btn.button('loading');
    $.ajax({
                    url: "say/add",
                    cache: false,
                    data: { text: ids, name:name },
                    type: "POST",
                    success: function(html) { $('#say').html(html);}
    }).always(function () {
      btn.button('reset')
    });
     return false;
  });
    });

in a trace. once try a tool like firebug and you will notice how life becomes better))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question