By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,453 Members | 932 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,453 IT Pros & Developers. It's quick & easy.

About the use of double colons in javascript ::

P: n/a
Hi,

I have seen a script using double colon in javascript. Is there
examples somewhere?
Curious me...

Jean Pierre
Jul 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
In article <Ld******************@wagner.videotron.net>, "Québec" <jp**@vidn.ca>
writes:
Hi,

I have seen a script using double colon in javascript. Is there
examples somewhere?


Well, ummm, perhaps an "example" might be the one where you saw it? And maybe
even a URL to such page to see what they are using it for?
--
Randy
Jul 20 '05 #2

P: n/a
Québec wrote:
I have seen a script using double colon in javascript. Is there
examples somewhere?


If you provide them. So far there is no `::' operator
in the JavaScript language, not even in v2.0 with classes.
PointedEars
Jul 20 '05 #3

P: n/a
Québec wrote:
I have seen a script using double colon in javascript. Is there
examples somewhere?


Maybe you mean the namespace lookup operator of JavaScript 2.0
(with classes):

http://www.mozilla.org/js/language/j...html#namespace
http://www.mozilla.org/js/language/j...amespaces.html
PointedEars
Jul 20 '05 #4

P: n/a
Can I have a small example of this?
"Thomas 'PointedEars' Lahn" <Po*********@web.de> wrote in message
news:bp*************@ID-107532.news.uni-berlin.de...
Québec wrote:
I have seen a script using double colon in javascript. Is there
examples somewhere?


Maybe you mean the namespace lookup operator of JavaScript 2.0
(with classes):

http://www.mozilla.org/js/language/j...html#namespace
http://www.mozilla.org/js/language/j...amespaces.html
PointedEars

Jul 20 '05 #5

P: n/a
[Top post repaired, please take your time to read
http://www.netmeister.org/news/learn2quote.html
more throughly if you want further answers.]

Québec wrote:
"Thomas 'PointedEars' Lahn" <Po*********@web.de> wrote [...]
Québec wrote:
I have seen a script using double colon in javascript. Is there
examples somewhere?


Maybe you mean the namespace lookup operator of JavaScript 2.0 (with
classes):

http://www.mozilla.org/js/language/j...html#namespace
http://www.mozilla.org/js/language/j...amespaces.html


Can I have a small example of this?


Since *you* have seen a script using the operator, *you* are to provide the
example. And no, I cannot provide one since JavaScript 2.0 as proposed by
waldemar has only one known implementation (Epimetheus) that I do not own
yet. More, ECMAScript Edition 4 is still a proposal and work on JavaScript
2.0 is still in progress. Thus I have not written any JavaScript 2.0
program yet.

I wonder if you mix up JavaScript with C(Script) here.
PointedEars
Jul 20 '05 #6

P: n/a
Since *you* have seen a script using the operator, *you* are to provide the example.

I found it back. It is only a colon.

<script language="JavaScript">
<!--
V1={
x:function(){
var A=prompt('First name...','');
var B=prompt('Last name...','');
alert(A + ' ' + B)}
};
V1.x()

//-->
</script>

{ x:5 }
defines a new object with a property named x, and the value of the
property is 5. Note : only works in recent browsers.

v = { x:5 };
changes the value of v to being an object with a property x, and the
value of the property is 5.

function() { ... }
defines a function object that doesn't have a personal name.

Therefore
v = { x:function() { ... } };
changes the value of v to being an object with a property, alias method,
named x, and the value of that property is a function object that can be
called by doing
v.x();
Jul 20 '05 #7

P: n/a
Québec wrote:
Since *you* have seen a script using the operator, *you* are to provide the

^^
Please repair your newsreader:
http://home.in.tum.de/~jain/software/oe-quotefix/
http://translate.google.com/translat...language_tools
example.

I found it back. It is only a colon.

<script language="JavaScript">


Use <script type="text/javascript"> to write valid HTML 4.
V1={
x:function(){
var A=prompt('First name...','');
var B=prompt('Last name...','');
alert(A + ' ' + B)}
};
[...]
function() { ... }
defines a function object that doesn't have a personal name.


That is called an `anonymous function'. When you display the code
of the function, i.e. the value of the `x' property here, with IE
(6), it even shows `function anonymous() ...'.
PointedEars
Jul 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.