PDA

View Full Version : Writting Cleaner Js Code?



incunix
21 Jun 2007, 3:05 AM
Hello,

Just wondering if anyone has any pointers on writting cleaner js applications. I seem to have accumulated a huge number of public variables and want to clean things up a little and even give my app a little more depth.

Thanks for your time, n.

incunix
21 Jun 2007, 3:22 AM
Found a good link on this:
http://yuiblog.com/blog/2007/06/12/module-pattern/
Let me know if there are any others please...

evant
21 Jun 2007, 3:30 AM
You can also write your javascript in classes, for example:



MyClass = function(config)
{
//constructor stuff
}

MyClass.prototype = {
method: function()
{
}
};

violinista
21 Jun 2007, 4:19 AM
Here is explanation of how to write good, standard Js application code:

http://extjs.com/forum/showthread.php?t=6564