How to Detect Browser Using Javascript

When it is about client-side programming you have to make everything cross-browser compatible and sometimes this requires detecting the browser your visitor is using and then run the related piece of code. Actually it is quite easy. What you need

Read More How to Detect Browser Using Javascript

JavaScript – Using ‘replace’ Method with a Callback Function

Many of the JavaScript samples on using 'replace' method will be basic samples showing you how to replace a predefined string with another predefined string. What if you want to find strings that match a specified criteria and replace them

Read More JavaScript – Using ‘replace’ Method with a Callback Function

How to – Replace All Instances of a String Using JavaScript

You have a string and you want to make some replacements on it. Lets say you want to find all occurances of a word and replace them with a space (” “). Lets say the word is “myword”. As far

Read More How to – Replace All Instances of a String Using JavaScript

How to – Recursive Anonymous JavaScript Functions

You want to call an anonymous function recursively? But anonymous functions don't have names how could you do that? Here is how… In javascript there is a property for this, “arguments.callee”. “arguments.callee” property contains a pointer to the currently executing

Read More How to – Recursive Anonymous JavaScript Functions

How to – Define JavaScript Functions

There are 3 ways you can define JavaScript Functions: 1- You can use “Function” constructor var total = new Function('a', 'b', 'c', 'return a + b + c;'); alert(total(1,1,1)); -> alerts '3' 2- You can use function declaration (This is

Read More How to – Define JavaScript Functions

Internet Explorer Mouseover / Hover Problem

There are many different ways to assign a mouse-over event handler on a div.   – You could set “onmouseover” property of the div <div id='myDiv' onmouseover='myFunction()'>content </div> – You could attach a handler using jquery a) $('#myDiv').mouseover(function (){…}); //short

Read More Internet Explorer Mouseover / Hover Problem