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(){});   […]

We know there are two event modes in javascript: capture mode and bubble mode. In capture mode, event flows from parent element to child element(i.e. from top to bottom), while […]

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 […]