Added line is this color
Deleted line is this color
+ +<h2>Some javascript functions...</h2> +<p><font face="Arial" size="2">As all of us know javascript is the mostly used +script language for web development. But we cann't say it is perfect one. Let +see some functions that will help us to avoid some javascript +problems....</font></p> +<p><font face="Arial"><font size="2"><strong><font color= +"#333399">typeof(a)</font></strong><br> + Though the typeof operator can be used to find the type of objects, it has +got some problems. so we can use the following global functions to wrap the +typeof operator.</font></font></p> +<p><font face="Arial"><font size="2"><font color= +"#333399"><strong>isIEObject(a)</strong></font><br> +Internet Explorer holds references to objects that are not actually javascript +objects. So if we use the objects in javascript it will give error. But the +typeof operator identifies them as javascript objects( problem!!!). Here we can +use the isIEObject() function to identify those +objects.</font></font><font face="Arial"><font size="2"><font color= +"#FF6600">Script:</font></font></font><font face="Arial" color="#3333FF" size= +"2">function isIEObject(a)<br> +{<br> + return isObject(a) && typeof a.constructor != 'function';<br> +}</font></p> +<p><br> +<font face="Arial"><font size="2"><strong><font color= +"#333399">isArray(a)</font></strong>This function returns true if a is an +array, meaning that it was produced by the Array constructor or by the [ ] +array literal notation.</font></font><font face="Arial" color="#FF6600" size= +"2">Script:</font><font face="Arial"><font size="2"><font color= +"#3333FF">function isArray(a)<br> +{<br> + return isObject(a) && a.constructor == Array;<br> +}</font><br> +<br> +<strong><font color="#333399">isBoolean(a)</font></strong><br> +This function returns true if a is one of the Boolean values, true or +false.<br> +<font color="#FF6600">Script:</font></font></font><font face="Arial" color= +"#3333FF" size="2">function isBoolean(a)<br> +{<br> + return typeof a == 'boolean';<br> +}</font></p> +<p><font face="Arial"><font size="2"><strong><font color= +"#333366">isEmpty(a)</font></strong><br> +This function returns true if a is an object or array or function containing no +enumerable members.</font></font><font face="Arial"><font size="2"><font color= +"#FF6633">Script:</font></font></font><font face="Arial" color="#3333FF" size= +"2">function isEmpty(o)<br> +{<br> + if (isObject(o))<br> + {<br> + for (var i in o)<br> + {<br> + return false;<br> + }<br> + }<br> + return true;<br> +}</font></p> +<p><br> +<font face="Arial"><font size="2"><strong><font color= +"#333399">isFunction(a)</font></strong><br> +This function returns true if a is a function. Beware that some native +functions in IE were made to look like objects instead of functions. This +function does not detect that.Netscape is better behaved in this regard.<br> +<font color="#FF6600">Script:</font></font></font><font face="Arial" color= +"#3333FF" size="2">function isFunction(a)<br> +{<br> + return typeof a == 'function';<br> +}</font></p> +<p><font face="Arial"><font size="2"><font color= +"#333399"><strong>isNull(a)</strong></font><br> +This function returns true if a is the null value.</font></font><font face= +"Arial" color="#FF6600" size="2">Script:</font><font face="Arial" color= +"#3333FF" size="2">function isNull(a)<br> +{<br> + return typeof a == 'object' && !a;<br> +}</font></p> +<p><font face="Arial"><font size="2"><font color="#3333CC"><strong><font color= +"#333399">isNumber(a)</font></strong></font>This function returns true if a is +a finite number. It returns false if a is NaN or Infinite. It also returns +false if a is a string that could be converted to a number.<br> +<font color="#FF6600">Script:</font></font></font><font face="Arial" color= +"#3333FF" size="2">function isNumber(a)<br> +{<br> + return typeof a == 'number' && isFinite(a);<br> +}</font></p> +<p><font face="Arial"><font size="2"><strong><font color= +"#333399">isObject(a)</font></strong><br> +This function returns true if a is an object, array, or function. It returns +false if a is a string, number, Boolean, null, or +undefined.</font></font><font face="Arial" color="#FF6600" size= +"2">Script:</font><font face="Arial" color="#3333FF" size="2">function +isObject(a)<br> +{<br> + return (typeof a == 'object' && !!a) || isFunction(a);<br> +}</font></p> +<p><font face="Arial"><font size="2"><font color= +"#333399"><strong>isString(a)</strong></font><br> +This function returns true if a is a string.<br> +<font color="#FF6600">Script:</font></font></font><font face="Arial" color= +"#3333FF" size="2">function isString(a)<br> +{<br> + return typeof a == 'string';<br> +}</font></p> +<p><font face="Arial"><font size="2"><strong><font color= +"#333399">isUndefined(a)</font></strong>This function returns true if a is the +undefined value. You can get the undefined value from an uninitialized variable +or from an object's missing member.<br> +<font color="#FF6633">Script:</font></font></font><font face= +"Arial"><font size="2"><font color="#3333FF">function isUndefined(a)<br> +{<br> + return typeof a == 'undefined';<br> +}</font></font></font></p>