วันพฤหัสบดีที่ 17 กันยายน พ.ศ. 2558

JQuery Datetimepicker event

$('.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
});

วันอังคารที่ 26 พฤษภาคม พ.ศ. 2558

ป้องกัน SQL Injection ใน Codeigniter

http://stackoverflow.com/questions/3797613/sql-injection-and-codeigniter

http://stackoverflow.com/questions/1615792/does-code-igniter-automatically-prevent-sql-injection

วันพฤหัสบดีที่ 26 มีนาคม พ.ศ. 2558

เรียกใช้ ControlCenter3 ไม้ได้

Printer Brother Software

ปัญหา
- เรียกใช้ ControlCenter3 ไม้ได้

วิธีแก้
- ลง Flash Player (IE activeX)

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
$.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).')';

วันอังคารที่ 3 มีนาคม พ.ศ. 2558

เปลี่ยนสีพื้นหลัง Windows Photo Viewer


- ไปที่ Run พิมพ์ Regedit

- เมื่อเปิด Registry Editor ขึ้นมาไปที่
HKEY_CURRENT_USER\Software\Microsoft\Windows Photo Viewer\Viewer

- จากนั้นสร้าง DWORD 32bit