Wednesday, September 22, 2010

Capture image through webcam and upload to server - PHP code

PHP Code for capture photo through web cam and save into your server.

take a snap through web cam and save into your database(DB)...

Source...

PHP code to capture image through webcam

PHP api to capture image through webcam.

PHP code for image capture.

download here...

real time testing page

Wednesday, September 15, 2010

CSS Compatibility and Internet Explorer

CSS Compatibility and Internet Explorer

With each new release of Windows Internet Explorer, support for the Cascading Style Sheets (CSS) standard has steadily improved. Internet Explorer 6 was the first fully CSS, Level 1-compliant version of Internet Explorer. Windows Internet Explorer 8 is fully compliant with the CSS, Level 2 Revision 1 (CSS 2.1) specification and supports some features of CSS Level 3 (CSS 3).

If your Web site targets browsers that include earlier versions of Internet Explorer, you want to know the level of CSS compliance for those versions. This article provides an at-a-glance look at CSS compliance across recent versions of Internet Explorer, including support in Internet Explorer 8.

More...

Friday, September 3, 2010

Remove tag without value from html element

Remove tag without value from HTML element and display only value of the Tag.

use the below function to remove the tag from HTML element.

function removeHTMLTags()
{

if(document.getElementById && document.getElementById("input-code"))
{
var strInputCode = document.getElementById("input-code").innerHTML;

/*
This line is optional, it replaces escaped brackets with real ones,
i.e. < is replaced with < and > is replaced with >
*/
strInputCode = strInputCode.replace(/&(lt|gt);/g, function (strMatch, p1){
return (p1 == "lt")? "<" : ">";
});

var strTagStrippedText = strInputCode.replace(/<\/?[^>]+(>|$)/g, "");
alert("Output text:\n" + strTagStrippedText);
// Use the alert below if you want to show the input and the output text
// alert("Input code:\n" + strInputCode + "\n\nOutput text:\n" + strTagStrippedText);
}

}

JQuery live focus and live blur bug fixing code

JQuery focus and blur event does not work with JQuery live event handler.

Here the solution for that. Just add the below code in you JQuery file or your java script file at the end.

and call your event like

$("Element").live("blur", function(){
// Your code goes here...
});

JQuery Blur and Focus code you need to add is here...

/****************************************************
JQUERY BLUR AND FOCUS EVENTS BUG FIXING CODE
****************************************************/

(function(){

var special = jQuery.event.special,
uid1 = 'D' + (+new Date()),
uid2 = 'D' + (+new Date() + 1);

jQuery.event.special.focus = {
setup: function() {
var _self = this,
handler = function(e) {
e = jQuery.event.fix(e);
e.type = 'focus';
if (_self === document) {
jQuery.event.handle.call(_self, e);
}
};

jQuery(this).data(uid1, handler);

if (_self === document) {
/* Must be live() */
if (_self.addEventListener) {
_self.addEventListener('focus', handler, true);
} else {
_self.attachEvent('onfocusin', handler);
}
} else {
return false;
}

},
teardown: function() {
var handler = jQuery(this).data(uid1);
if (this === document) {
if (this.removeEventListener) {
this.removeEventListener('focus', handler, true);
} else {
this.detachEvent('onfocusin', handler);
}
}
}
};

jQuery.event.special.blur = {
setup: function() {
var _self = this,
handler = function(e) {
e = jQuery.event.fix(e);
e.type = 'blur';
if (_self === document) {
jQuery.event.handle.call(_self, e);
}
};

jQuery(this).data(uid2, handler);

if (_self === document) {
/* Must be live() */
if (_self.addEventListener) {
_self.addEventListener('blur', handler, true);
} else {
_self.attachEvent('onfocusout', handler);
}
} else {
return false;
}

},
teardown: function() {
var handler = jQuery(this).data(uid2);
if (this === document) {
if (this.removeEventListener) {
this.removeEventListener('blur', handler, true);
} else {
this.detachEvent('onfocusout', handler);
}
}
}
};

})();


Now Call your blur / focus event

JQuery new features added in JQuery 1.4

Some good new features added in JQuery 1.4
JQuery features