SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
-
Jul 10, 2008, 01:37 #1
- Join Date
- Jun 2006
- Location
- Durban, South Africa
- Posts
- 287
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
YUI, extjs and similar coding styles
Hi all.
Looking around the net lately, it seems that more and javascript is being written in the same style as the YUI, extjs and openwysiwyg style. Example below
Code:var test = { a_func: function() { blah blah } }
From what it looks like to me, it simulates a class, is that correct?
So how exactly does it all work?
How do you create private / public variables?
Are there any sights out there that explain how this style of coding works?
Thanks in advance
-
Jul 10, 2008, 12:47 #2
This is basically JSON (JavaScript Object Notation) style notation. The major advantage is that it allows you to build very complex objects and namespace with a relatively small amount of script.
A side advantage is that the script tends to become more readable to people who are used to working in curly-bracket style object oriented languages like C#, Java or C++.
If you work with very large blocks of JavaScript (as I do), you'll find that the code become somewhat easier to manage when you look at it. It's neater when you get used to it.
-
Jul 11, 2008, 03:34 #3
- Join Date
- Jun 2006
- Location
- Durban, South Africa
- Posts
- 287
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Cool thanks for the reply. Seems replies on this topic are a bit scarce...
Do you have any good reference sites. Iv had a look on the net, but so far have found really bad sites.
Thanks a lot for the reply though, has helped a bit
-
Jul 11, 2008, 06:17 #4
Here's one i came across, which seems to be OK.
I don't have any great references. I've been programming JavaScript for about 10 years now, so I don't use them much.
mckoss.com/jscript/object.htm
-
Jul 11, 2008, 06:30 #5
- Join Date
- Jun 2006
- Location
- Durban, South Africa
- Posts
- 287
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks man looks pretty good.
Bookmarks