Archive for the ‘Jquery’ Category
jquery datatable trigger sort
31/07/2019
Leave a comment
I use .order() instead of .sort(). Example:
$(‘#dataTables-example’).DataTable().order([0, ‘desc’]).draw();
where 0
is the id of the column. // 0 first column
nhantam
Convert PSD to WordPress
Categories: Jquery
jquery no space allowed in username input
12/09/2015
Leave a comment
dùng javascript, jquery xóa bỏ khoảng trắng với các các field đăng nhập như username input text
var username = $('#username').val();
var username = username.replace(/\s+/g, '');
$('#username').val(username);
Chúc các bạn thành công
nhantam
thiet ke web
Jquery serialize form id
25/08/2015
Leave a comment
Khi các bạn submit form bằng method serialize của jquery và chỉ định form id thì làm như sau:
form id="frm_contact"
.... html input tag
Jquery javascript:
var f = $("form#frm_contact");
$.ajax({ type: "POST",
url: http://www.panpic.vn/process.php,
async: false,
data: f.serialize(),
success: function(text){
alert(text);
}
});
Chúc thành công
nhantam
Web developer team in Vietnam
Categories: Jquery, Scripts
Jquery serialize form id, serialize by id