mrkeck Sharing the Love

24Aug/120

MSAccess Web Browser Suppress Errors

web1.Silent = true

Makes it so no script errors popup.

Filed under: msaccess No Comments
24Aug/120

PHP GD Add TImestamp to Image

addTimestamp("theImg.jpg");
function addTimestamp($imgName){
	//Get image
	$img = ImageCreateFromJPEG($imgName);
	//Make timestamp image
	$im = imagecreatetruecolor(240, 200);
	$color_black = ImageColorAllocate($img, 255, 255, 255); 
	imagestring($im,5,0,0,date('c'),$color_black);
	//Put timestamp image on top of main image
	imagecopymerge($img, $im, 0, 0, 0, 0, 240, 20, 60);
	//Overwrite original with one with timestamp
	imagejpeg($img,$imgName,100);
}
Filed under: GD, PHP No Comments
4Aug/120

Simulate Mouse Click with Javascript/jQuery

//Find thing you want to click
var ele=$('.thingToClick')[0];
 
//Function that performs the click
var doClick=function(ele){
  var evt = document.createEvent("MouseEvents");
  evt.initMouseEvent("click", true, true, window,
	0, 0, 0, 0, 0, false, false, false, false, 0, null);
  return ele.dispatchEvent(evt);
};
 
//Call the click
doClick(ele);
Filed under: Javascript, jquery No Comments