Singleton in JavaScript
Posted: Thu Aug 10, 2006 4:04 am
Not so much a question, more of a useful resource pointer.
After reading articles by people who don't know what they're talking about, like this:
http://dhtmldev.com/content/view/27/26/ (Don't take this on-board - it's wrong!)
WTF do they mean?? In their own terms JS is not an object oriented language?? OK then whatever... I always wondered what all the dot syntax was about... they obviously just like full-stops
I finaly found a good implementation here:
http://www.webreference.com/programming ... mn5/2.html
It can be done with static properties just like PHP
I needed this for some Request/Response objects in a pretty dynamic interactive ajax application and for Input/Output objects. Works a peach.
After reading articles by people who don't know what they're talking about, like this:
http://dhtmldev.com/content/view/27/26/ (Don't take this on-board - it's wrong!)
WTF do they mean?? In their own terms JS is not an object oriented language?? OK then whatever... I always wondered what all the dot syntax was about... they obviously just like full-stops
I finaly found a good implementation here:
http://www.webreference.com/programming ... mn5/2.html
It can be done with static properties just like PHP
I needed this for some Request/Response objects in a pretty dynamic interactive ajax application and for Input/Output objects. Works a peach.