Archive

Archive for the ‘Jquery’ Category

jquery datatable trigger sort

https://datatables.net

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

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

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