Archive for the ‘Javascript’ Category
Posted on November 12, 2008
I was taking part in developing an interesting web application - the Thank You Project. During which I made an item rotator script that swaps a list of messages in and out from the message board. I find the rotator script is very useful, so I decide to share it. To get an overview of [...]
Posted on October 1, 2008
In Ajax programming development, passing data back and forth between client and server is a common task. There are two major data formats that one can use for this purpose, namely XML and JSON. My personal preference is JSON because I find it's less verbose and easier to parse.
Although latest PHP provides a very handy [...]
Posted on May 2, 2008
In YUI's Animation Utility example page there are demonstrations on how to create color and motion animations. However I couldn't find an example for how to create fading effect. After spending some time on trying different approaches, I came up with this code snip:
function doFade(){
YAHOO.util.Dom.setStyle(document.body, 'opacity', '0');
var ani = new YAHOO.util.Anim(document.body , {
opacity: {from: [...]
Posted on April 30, 2008
Creating a Digg This button is very easy. Here's a non-plugin approach:
<script type="text/javascript">
digg_url = '< ?php the_permalink() ?>';
digg_title = '< ?php the_title() ?>';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
Copy and paste above script to anywhere between your WordPress' theloop:
digg_url = 'http://thecodecentral.com/2008/04/30/creating-a-digg-this-button-for-your-wordpress-blog';
digg_title = 'Creating a Digg This Button for Your WordPress Blog';
Instead post specific Digg button, you can create [...]
Posted on March 18, 2008
The complexity of JavaScript code has increased rapidly over the last two years. The emerging of various JavaScript libraries/frameworks along with Ajax technology enable us to build sophisticate applications which are comparable to desktop ones. A mid-size to large-size Ajax/JavaScript applications normally consist of thousands lines of code. For readability and navigability, it is practical [...]