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

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

strip_tags(“hello <p> world</p>”)–> “hello word” list($a,$b,$c)=$myarray; $a<=$myarray[0],$b<=$myarray[1],$c=$myarray[2] compact(“variablename1″,”variablename2″,…”) returns an array whose members are “variablename1″=>$variablename1, “variablename2″=>$variablename2, …. if $variablename is not in the current scope, compact won’t include it. array_rand($arr) […]