Answer the question
In order to leave comments, you need to log in
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
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;
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question