Findings and Notes in Web Development

jQuery

Writing jQuery Plugin 101

I often struggle to get my Javascript code organized, and have tried numerous ways to do so. I have tried putting relevant code into classes and instantiate as needed, then abuse jQuery’s data() method to store everything (from scalar values to functions and callbacks). Recently, after knowing (briefly) how a jQuery plugin should be written, it does greatly simplify my code.

Continue reading

  • Post Meta

Maintaining State with jQuery Event

Maintaining state in Javascript is not too difficult once you catch the idea. However, as I am not a super brilliant programmer, it takes me some time to find a way to maintain state as YUI Event does in jQuery.

Continue reading

  • Post Meta

    • Jeffrey04
    • Javascript
    • No comments
    • 2009-05-4
    • 21:17

Proof of Concept: YQuery

After the last post, I found that it may be fun to write a wrapper for YUI in order to make it behave like jQuery. Therefore, the code below is clearly mainly for self-amusement and is not intended to be used in production projects. However, through coding this, I found that although the difference in design, but YUI is obviously capable to do what jQuery offers (if not more). I will not continue working on this so whoever interested may just copy and paste the code to further developing it.

Continue reading

  • Post Meta

    • Jeffrey04
    • Javascript
    • No comments
    • 2009-05-4
    • 21:01