javascript

A few things about js replace method: var anotherstr=str.replace(/<[^<>]+>/g, function(m) { return m.replace( /__i__|%i%/g, n );}); First, str.replace does not change str itself, the result is saved in anotherstr. Second, […]

jQuery slideDown function shows an element from top to bottom in specified time. slideUp function hides an element from bottom to top in specified interval. $(element).slideDown(interval, function(){}); $(element).slideUp(interval, function(){});   […]

I’ve been confused with javascript event model for long time. You must know there are two event models in javascript: capturing model and bubbling model. Every article describing event model […]

How to debug JavaScript in FireFox?

Firebug add-on makes debugging javascript code very easy. After installing firebug extension in firefox and opening a webpage, you can see a new menu item in the context menu of […]