I am currently re-writing a huge chunk of our CMS front end. The majority of this is JavaScript previously written using Prototype and script.aculo.us and I am taking a jQuery hammer to it.

One of the biggest problems I faced when I first wrote the script was not being able to set parameters in call back functions. This meant I had to either use globals or modify classes and then get them back.

So this time around I did a little research and found this great function from John Resig, which allows you to do just that, pre fill arguments for call back functions. Essentially it stores the arguments until you run the function, at which point it puts it all together again.

This has cut down my code significantly, so thanks John!

This entry was posted on Tuesday, December 2nd, 2008 at 10:48 am and is filed under Random. You can leave a comment and follow any responses to this entry through the RSS 2.0 feed.

Leave a Reply