$('.birth_date').datetimepicker({
pickTime:false,
pick12HourFormat: false,
language: 'th',
icons: {
time: "fa fa-clock-o",
date: "fa fa-calendar",
up: "fa fa-arrow-up",
down: "fa fa-arrow-down"
},
format:"LL"
}).on("change.dp",function(e){
//event here
});
แสดงบทความที่มีป้ายกำกับ jQuery แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ jQuery แสดงบทความทั้งหมด
วันพฤหัสบดีที่ 17 กันยายน พ.ศ. 2558
JQuery Datetimepicker event
วันพฤหัสบดีที่ 26 มีนาคม พ.ศ. 2558
jQuery event for dynamic content
code
$.ajax({
$('body').on('click','.some-selector',function(){
//do something
});
$(document).on('click','.some-selector',function(){
//do something
});
วันอังคารที่ 24 มีนาคม พ.ศ. 2558
jQuery(jsonp) + PHP
javascript code
PHP code
$.ajax({
url: "http://example.com/load_data.php",
dataType: "jsonp",
jsonpCallback: 'jsonCallback',
success: function(data){
alert("success");
},
error:function(){
alert("failure");
}
});
PHP code
header("Content-Type: application/json");
require_once "connect_db.php";
$sql = "select * from Table";
$res = mysql_query($sql) or die(mysql_error());
$data = array();
while($row = mysql_fetch_array($res)){
array_push($data,$row);
}
echo $_GET['callback'].'('.json_encode($data).')';
วันพุธที่ 4 ธันวาคม พ.ศ. 2556
jQuery $(this) vs this
http://stackoverflow.com/questions/1051782/jquery-this-vs-this
$(this)[0] == this
$("#myDiv")[0] == document.getElementById("myDiv");
วันศุกร์ที่ 15 พฤศจิกายน พ.ศ. 2556
jQuery for dynamic content
http://stackoverflow.com/questions/15090942/jquery-on-method-not-working-on-dynamic-content
$(document.body).on('click', '.update' ,function(){ });
วันอาทิตย์ที่ 26 พฤษภาคม พ.ศ. 2556
PHP + MySQL + jQuery.tablePagination0.5 (การแบ่งหน้าข้อมูลโดยใช้ตาราง)
การแบ่งหน้าแบบง่ายโดยอาศัย plugin ที่ชื่อว่า jQuery.tablePagination0.5
ดาวน์โหลด jQuery.tablePagination0.5
จาก source ดังกล่าว จะได้ผลลัพธ์ดังนี้
ดาวน์โหลด jQuery.tablePagination0.5
จาก source ดังกล่าว จะได้ผลลัพธ์ดังนี้
สมัครสมาชิก:
บทความ (Atom)
