Today it turns out I  got a big misunderstanding of HTML checkbox. I thought <input type=”checkbox”  value=”1″> will check the box, while <input type=”checkbox”  value=”0″> will uncheck the box. Unfortunately, […]

php require() will die if the included file has a syntax error even the error line is not executed(i.e., within a function that is not called) for example: file1.php <?php […]

How to create/use WordPress sidebar?

We should know first what sidebar is in WordPress. A WordPress page is divided into header, sidebar, content, and footer.   A WordPress page is displayed according to the page […]

How to write a WordPress Widget?

WordPress widget is good re-usable component for developing WordPress sites. You must have dragged and dropped widgets in wordpress admin panel. If you are a wordpress savvy, you may have […]

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