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

You should edit the file: wp-includes/version.php to change $wp_version = ‘3.9.3’ to $wp_version = ‘3.9.3-src’. After doing that, a  wordpress site will load development version of javascript files instead of […]

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

If you do not use header() in your php script, what are the default http headers your browser gets? Here are the http headers php 5.4 generates in the response: […]