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

How to write a WordPress plugin?

What is wordpress plugin? A WordPress plugin is a php file in the directory wp-content\plugins\. Complex plugin may have multiple files and more complex directory structure. It can use a […]

Of course, you can put echo or print statements somewhere in the debugged php file to print some messages or value of variables. More convenient way is using an IDE […]

An array can be converted to an object in PHP. <?php $a=array(“aa”,”bb”); $a=(object)$a ?> However you can not access the member of $a because there is not a name for […]