473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

About the use of double colons in javascript ::

Hi,

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

Jean Pierre
Jul 20 '05 #1
7 7824
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
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
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
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
[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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

45
by: Edward K. Ream | last post by:
Hello all, First of all, my present state of mind re pep 318 is one of sheepish confusion. I suspect pep 318 will not affect Leo significantly, but I am most surprised that an apparently...
2
by: brian | last post by:
question about Onload function can one define more than one function for Onload ? <body Onload="function1()"> or can one define multiple functions one after another like <body Onload="f() g()...
13
by: John | last post by:
Hi all: In my code I define a class with inline constructor. But it does not work. I describe the class as below: myclass{ public: myclass(int a, int b) { r1 = a; r2 = b;} protected:
38
by: Arjang | last post by:
http://www.codeproject.com/useritems/CSharpVersusVB.asp
2
by: D H | last post by:
Hi, Hi, I was looking for your opinion on VB.NET - its long-term prospects, etc. Sorry this is vague, but it's not meant to be a troll. It's a pro-VB.NET post actually. I haven't used VB or...
10
by: chanma | last post by:
code1:var x=0xf0000000; alert(x); output:4026531840 code2:var b=0xf<<28; alert(b); output:-268435456
9
by: Jeremy | last post by:
I apologize if this is the wrong group, but my usenet provider doesn't carry any CSS-specific groups, and people in this group are likely to be CSS experts anyhow. My question is this: In HTML,...
6
by: Grant Robertson | last post by:
I am relatively new to XML, though I have taught myself a lot in the past month. I keep seeing namespace names with multiple colons in them such as: "urn:oasis:names:tc:entity:xmlns:xml:catalog"...
26
by: machineghost | last post by:
First off, let me just say that as someone with no DBA training whatsoever, any help I can get with this issue will be very, very much appreciated. My company recently migrated our database from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.