Reference

  • Revision slug: Talk:JavaScript/Reference
  • Revision title: Reference
  • Revision id: 189512
  • Created:
  • Creator: Sevenspade
  • Is current revision? No
  • Comment /* JS 1.2 and Gecko 1.8 */ Explaining my edits and thoughts on JavaScript 1.2

Revision Content

Terminology

We need a terminology appendix. For example, "script" and "program" are synonymous. So are "current object" and "context object". We could also put in layman definitions there for JS constructs like functions and variables. --Maian 01:43, 30 September 2005 (PDT)

JS 1.2 and Gecko 1.8

Per the fix for bug 255895, "JavaScript1.2" values for the script's language attribute no longer work, e.g. <script language="JavaScript1.2"> will execute the script in the latest JS version rather than JS 1.2.

So how should this be documented? In Fx 1.0, JS 1.2 is available, but not in the upcoming Fx 1.5. There are 5 cases where "JavaScript1.2" is mentioned in this reference: Special:Search?search=JavaScript1.2&go=Go. How should they be revised?

--Maian 23:43, 21 September 2005 (PDT)

I think we need a new section in the reference that specifies the differences between versions, collecting this information into a single location rather than leaving it scattered haphazardly throughout the reference as it currently is. Once that is done, the various code samples should be updated to reflect current practices and code if they cannot be written in a "version-neutral" manner. Do you think this makes sense? -- dria 04:27, 22 September 2005 (PDT)
Those examples are not "bad examples" per se. They are there specifically to show the differences between the two versions. I was wondering what should be done about those examples, since they would no longer be valid with Fx 1.5+ and family. BTW, https://bugzilla.mozilla.org/attachment.cgi?id=195375 is a screenshot of a table of differences. --Maian 05:10, 22 September 2005 (PDT)
If the examples are there specifically to show the differences between two versions of JS, and if we have a section in the reference that is dedicated to discussing these differences, I would think that those samples should be included in that section of the reference. Or am I misunderstanding something? -- dria 05:30, 22 September 2005 (PDT)
The examples (or most of them at least) say that the browser can use the JS 1.2 engine with the language="JavaScript1.2" tag, but this is no longer possible; language="JavaScript1.x" tags will always use the current version now, i.e. JS 1.6. So while the examples do show what JS 1.2 does, they incorrectly indicate that it's possible to switch to the 1.2 engine. --Maian 05:41, 22 September 2005 (PDT)
This is true. The wording should be changed with the Javascript 1.x examples, as well as refer to the versions in the past tense. I also support the use of a deprecated pre box with these examples. Since it's been 9 months since the last comment on this, I think I'll go ahead and change all of the examples. If anyone disagrees, you can always revert. Sevenspade 13:19, 2 July 2006 (PDT)
After some thought, I removed the references to using LANGUAGE="JavaScript1.2", and all references are merely presented as information detailing past behavior. The "Backwards compatibility" sections have been renamed to "Behavior in older versions." However, I think this is only appropriate if we are going to document the evolution of everything, or at least note the most significant changes introduced in the various versions.
Otherwise, I think we should just remove the "Behavior in other versions" sections, and rename the "JavaScript 1.2" section headings to something like "Differences with JavaScript 1.2," as well as include a link to the yet-to-be-written JavaScript 1.2 page documenting the various oddities and deviations made in that version, something which I think we should do anyway. Maybe something like Main Article: JavaScript 1.2--Sevenspade 15:16, 6 July 2006 (PDT)

SGML comment hiding quirks

SGML comment hiding needs to be mentioned here and its consequences. Brendan just mentioned one obscure one here: https://bugzilla.mozilla.org/show_bug.cgi?id=310993#c20 --Maian 22:46, 5 October 2005 (PDT)

Section title capitalization

There's an inconsistency in the capitalization of section titles. Some capitalize everything as if it's a book title. Others just capitalize the first word. Which scheme should we take, or does it even matter? --Maian 07:11, 8 September 2005 (PDT)

If you want to make them consistent, I think we should go with the "First word only" capitalization, rather than the book-title style. Thanks :) -- dria

deprecated pre box

Is there any wiki markup available for deprecated examples?

--Maian 20:24, 25 Aug 2005 (PDT)

Help:Custom_Templates#Template:deprecated_header --Nickolay 00:58, 26 Aug 2005 (PDT)
Hmm, that was a bad question. What I meant to ask is: what markup should I use for bad examples (which aren't necessarily deprecated), i.e. examples that show what not to do? --Maian 02:07, 26 Aug 2005 (PDT)
Oh, I don't think so, but you can ask dria to create a CSS class for that. --Nickolay 11:50, 26 Aug 2005 (PDT)
I'll add it to my TODO list for the new skins. I have to go through them again this weekend to fix up some stuff anyhow. Good idea, Maian. Thanks :) -- dria 21:06, 26 Aug 2005 (PDT)

coding style

Should semicolons be added to all the examples?

--Maian 21:06, 25 Aug 2005 (PDT)

The original authors didn't use semicolons, but I'd add them. --Nickolay 00:58, 26 Aug 2005 (PDT)

(More coding style questions) --Maian 04:06, 31 Aug 2005 (PDT)

I'd say, just make a note here about decisions you make. It would be best to have all examples to use the same style. --Nickolay 05:37, 31 Aug 2005 (PDT)
Gonna follow Mozilla's coding guides here: http://www.mozilla.org/hacking/mozilla-style-guide.html#Visual --Maian 00:30, 20 September 2005 (PDT)

btoa() and atob() base64 encode and decode functions

This documentation is missing the base64 encode (btoa) and decode (atob) functions. Anyone know why this has been left out?

Danbeck 07:02, 22 September 2005 (PDT)

AFAICT , base64-related functionality is not a part of the JavaScript engine, but a DOM feature (probably non-standard). --Nickolay 08:31, 22 September 2005 (PDT)
What's funny is that this Talk page shows up first in a Google search for "btoa javascript". This is number 2. It's not in the ECMA docs. If it's not in a standard, and that Sun doc is corrent, then it should probably go in the window object methods. --Jonnyq
I've already added those methods in the methods listing, but I haven't defined them yet. --Maian 02:39, 21 October 2005 (PDT)


delete?

I don't see any mention in the operators section for the delete operator. Did this operator get removed/deprecated, or is it missing from the documentation?

Brundlefly 13:15, 19 December 2005 (PST)

Neither: Core JavaScript 1.5 Reference:Operators:Special Operators:delete Operator --Nickolay 14:48, 19 December 2005 (PST)

reading offline?

Well, may be it's no so common in today's world... but is there a way to get content of jsref-1.5 or other documents as a tarball? There are still valid needs for this: computers on slow links, computers behind insane firewalls, as well as computers not connected to internet.

Unfortunately there is not an [easy] method to download content/packages of content off of DevMo for 'local' browsing/viewing/printing, yet. It is in the "Nice to have" Category for us here, however I am unaware of anyone feverishly working on it. (There are some other priorities ahead of that, imho). If downloading the stuff is your priority you are free to field ideas/concept to the DevMo Mailing List for discussion, and then actually code it (or find someone to do so). Thanks for your thoughts --Callek 15:05, 13 January 2006 (PST)

Notification when reorganization is finished

Leandro (localiser for the Portuguese wiki) would like to be emailed when the JS Reference reorganization has been finished. His user page is here: http://developer.mozilla.org/pt/docs/Usu%C3%A1rio:Leandro_Merc%C3%AAs_Xavier

-- dria 08:19, 24 February 2006 (PST)

Revision Source

<h3 name="Terminology"> Terminology </h3>
<p>We need a terminology appendix. For example, "script" and "program" are synonymous. So are "current object" and "context object". We could also put in layman definitions there for JS constructs like functions and variables. --<a href="User:Maian">Maian</a> 01:43, 30 September 2005 (PDT)
</p>
<h3 name="JS_1.2_and_Gecko_1.8"> JS 1.2 and Gecko 1.8 </h3>
<p>Per the fix for <a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=255895">bug 255895</a>, "JavaScript1.2" values for the script's language attribute no longer work, e.g. <code>&lt;script language="JavaScript1.2"&gt;</code> will execute the script in the latest JS version rather than JS 1.2.
</p><p>So how should this be documented? In Fx 1.0, JS 1.2 is available, but not in the upcoming Fx 1.5. There are 5 cases where "JavaScript1.2" is mentioned in this reference: <a href="Special:Search?search=JavaScript1.2&amp;go=Go">Special:Search?search=JavaScript1.2&amp;go=Go</a>. How should they be revised?
</p><p>--<a href="User:Maian">Maian</a> 23:43, 21 September 2005 (PDT)
</p>
<dl><dd> I think we need a new section in the reference that specifies the differences between versions, collecting this information into a single location rather than leaving it scattered haphazardly throughout the reference as it currently is.  Once that is done, the various code samples should be updated to reflect current practices and code if they cannot be written in a "version-neutral" manner. Do you think this makes sense? -- <a href="User:Dria">dria</a> 04:27, 22 September 2005 (PDT)
</dd></dl>
<dl><dd><dl><dd> Those examples are not "bad examples" per se. They are there specifically to show the differences between the two versions. I was wondering what should be done about those examples, since they would no longer be valid with Fx 1.5+ and family. BTW, https://bugzilla.mozilla.org/attachment.cgi?id=195375 is a screenshot of a table of differences. --<a href="User:Maian">Maian</a> 05:10, 22 September 2005 (PDT)
</dd></dl>
</dd></dl>
<dl><dd><dl><dd><dl><dd> If the examples are there specifically to show the differences between two versions of JS, and if we have a section in the reference that is dedicated to discussing these differences, I would think that those samples should be included in that section of the reference.  Or am I misunderstanding something? -- <a href="User:Dria">dria</a> 05:30, 22 September 2005 (PDT)
</dd></dl>
</dd></dl>
</dd></dl>
<dl><dd><dl><dd><dl><dd><dl><dd> The examples (or most of them at least) say that the browser can use the JS 1.2 engine with the <code>language="JavaScript1.2"</code> tag, but this is no longer possible; <code>language="JavaScript1.x"</code> tags will always use the current version now, i.e. JS 1.6. So while the examples do show what JS 1.2 does, they incorrectly indicate that it's possible to switch to the 1.2 engine. --<a href="User:Maian">Maian</a> 05:41, 22 September 2005 (PDT)
</dd></dl>
</dd></dl>
</dd></dl>
</dd></dl>
<dl><dd><dl><dd><dl><dd><dl><dd><dl><dd> This is true. The wording should be changed with the Javascript 1.x examples, as well as refer to the versions in the past tense. I also support the use of a <a href="Talk:en/Core_JavaScript_1.5_Reference#deprecated_pre_box">deprecated pre box</a> with these examples. Since it's been 9 months since the last comment on this, I think I'll go ahead and change all of the examples. If anyone disagrees, you can always revert. <a href="User:Sevenspade">Sevenspade</a> 13:19, 2 July 2006 (PDT)
</dd></dl>
</dd></dl>
</dd></dl>
</dd></dl>
</dd></dl>
<dl><dd><dl><dd><dl><dd><dl><dd><dl><dd> After some thought, I removed the references to using <code>LANGUAGE="JavaScript1.2"</code>, and all references are merely presented as information detailing past behavior. The "Backwards compatibility" sections have been renamed to "Behavior in older versions." However, I think this is only appropriate if we are going to document the evolution of everything, or at least note the most significant changes introduced in the various versions.
</dd><dd> Otherwise, I think we should just remove the "Behavior in other versions" sections, and rename the "JavaScript 1.2" section headings to something like "Differences with JavaScript 1.2," as well as include a link to the yet-to-be-written JavaScript 1.2 page documenting the various oddities and deviations made in that version, something which I think we should do anyway. Maybe something like <i>Main Article: <a href="en/JS/JavaScript_1.2">JavaScript 1.2</a></i>--<a href="User:Sevenspade">Sevenspade</a> 15:16, 6 July 2006 (PDT)
</dd></dl>
</dd></dl>
</dd></dl>
</dd></dl>
</dd></dl>
<h3 name="SGML_comment_hiding_quirks"> SGML comment hiding quirks </h3>
<p>SGML comment hiding needs to be mentioned here and its consequences. Brendan just mentioned one obscure one here: https://bugzilla.mozilla.org/show_bug.cgi?id=310993#c20 --<a href="User:Maian">Maian</a> 22:46, 5 October 2005 (PDT)
</p>
<h3 name="Section_title_capitalization"> Section title capitalization </h3>
<p>There's an inconsistency in the capitalization of section titles. Some capitalize everything as if it's a book title. Others just capitalize the first word. Which scheme should we take, or does it even matter? --<a href="User:Maian">Maian</a> 07:11, 8 September 2005 (PDT)
</p>
<dl><dd> If you want to make them consistent, I think we should go with the "First word only" capitalization, rather than the book-title style.  Thanks :) -- <a href="User:Dria">dria</a>
</dd></dl>
<h3 name="deprecated_pre_box"> deprecated pre box </h3>
<p>Is there any wiki markup available for deprecated examples?
</p><p>--<a href="User:Maian">Maian</a> 20:24, 25 Aug 2005 (PDT)
</p>
<dl><dd> <a href="Help:en/Custom_Templates#Template:deprecated_header">Help:Custom_Templates#Template:deprecated_header</a> --<a href="User:Nickolay">Nickolay</a> 00:58, 26 Aug 2005 (PDT)
</dd></dl>
<dl><dd><dl><dd> Hmm, that was a bad question.  What I meant to ask is: what markup should I use for <i>bad</i> examples (which aren't necessarily deprecated), i.e. examples that show what not to do? --<a href="User:Maian">Maian</a> 02:07, 26 Aug 2005 (PDT)
</dd></dl>
</dd></dl>
<dl><dd><dl><dd><dl><dd> Oh, I don't think so, but you can ask dria to create a CSS class for that. --<a href="User:Nickolay">Nickolay</a> 11:50, 26 Aug 2005 (PDT)
</dd></dl>
</dd></dl>
</dd></dl>
<dl><dd><dl><dd><dl><dd><dl><dd> I'll add it to my TODO list for the new skins.  I have to go through them again this weekend to fix up some stuff anyhow.  Good idea, Maian.  Thanks :) -- <a href="User:Dria">dria</a> 21:06, 26 Aug 2005 (PDT)
</dd></dl>
</dd></dl>
</dd></dl>
</dd></dl>
<h3 name="coding_style"> coding style </h3>
<p>Should semicolons be added to all the examples?
</p><p>--<a href="User:Maian">Maian</a> 21:06, 25 Aug 2005 (PDT)
</p>
<dl><dd> The original authors didn't use semicolons, but I'd add them. --<a href="User:Nickolay">Nickolay</a> 00:58, 26 Aug 2005 (PDT)
</dd></dl>
<p>(More coding style questions) --<a href="User:Maian">Maian</a> 04:06, 31 Aug 2005 (PDT)
</p>
<dl><dd> I'd say, just make a note here about decisions you make. It would be best to have all examples to use the same style. --<a href="User:Nickolay">Nickolay</a> 05:37, 31 Aug 2005 (PDT)
</dd></dl>
<dl><dd><dl><dd> Gonna follow Mozilla's coding guides here: http://www.mozilla.org/hacking/mozilla-style-guide.html#Visual --<a href="User:Maian">Maian</a> 00:30, 20 September 2005 (PDT)
</dd></dl>
</dd></dl>
<h3 name="btoa.28.29_and_atob.28.29_base64_encode_and_decode_functions"> btoa() and atob() base64 encode and decode functions </h3>
<p>This documentation is missing the base64 encode (btoa) and decode (atob) functions.  Anyone know why this has been left out?
</p><p><a href="User:Danbeck">Danbeck</a> 07:02, 22 September 2005 (PDT)
</p>
<dl><dd> AFAICT <a class="external" href="http://lxr.mozilla.org/seamonkey/search?string=base64">, base64-related functionality is not a part of the JavaScript engine, but a DOM feature (probably non-standard). --</a><a href="User:Nickolay">Nickolay</a> 08:31, 22 September 2005 (PDT)
<dl><dd> What's funny is that this Talk page shows up first in a Google search for "btoa javascript".  <a class="external" href="http://docs.sun.com/source/816-6408-10/window.htm">This</a> is number 2.  It's not in the ECMA docs.  If it's not in a standard, and that Sun doc is corrent, then it should probably go in the <a href="en/DOM/window">window</a> object methods. --<a href="User:Jonnyq">Jonnyq</a>
<dl><dd> I've already added those methods in the methods listing, but I haven't defined them yet. --<a href="User:Maian">Maian</a> 02:39, 21 October 2005 (PDT)
</dd></dl>
</dd></dl>
</dd></dl>
<p><br>
</p>
<h3 name="delete.3F"> <code><b>delete</b></code>? </h3>
<p>I don't see any mention in the operators section for the <code><b>delete</b></code> operator.  Did this operator get removed/deprecated, or is it missing from the documentation?
</p><p><a href="User:Brundlefly">Brundlefly</a> 13:15, 19 December 2005 (PST)
</p>
<dl><dd> Neither: <a href="en/Core_JavaScript_1.5_Reference/Operators/Special_Operators/delete_Operator">Core JavaScript 1.5 Reference:Operators:Special Operators:delete Operator</a> --<a href="User:Nickolay">Nickolay</a> 14:48, 19 December 2005 (PST)
</dd></dl>
<h3 name="reading_offline.3F"> reading offline? </h3>
<p>Well, may be it's no so common in today's world... but is there a way to get content of jsref-1.5 or other documents as a tarball? There are still valid needs for this: computers on slow links, computers behind insane firewalls, as well as computers not connected to internet.
</p>
<dl><dd> Unfortunately there is not an <span class="plain">[easy]</span> method to download content/packages of content off of DevMo for 'local' browsing/viewing/printing, <b>yet</b>.  It is in the "Nice to have" Category for us here, however I am unaware of anyone feverishly working on it.  (There are some other priorities ahead of that, imho).  If downloading the stuff is your priority you are free to field ideas/concept to the <a href="Project:en/Community#Mailing_List">DevMo Mailing List</a> for discussion, and then actually code it (or find someone to do so).  Thanks for your thoughts --<a href="User:Callek">Callek</a> 15:05, 13 January 2006 (PST)
</dd></dl>
<h3 name="Notification_when_reorganization_is_finished"> Notification when reorganization is finished </h3>
<p>Leandro (localiser for the Portuguese wiki) would like to be emailed when the JS Reference reorganization has been finished.  His user page is here: http://developer.mozilla.org/pt/docs/Usu%C3%A1rio:Leandro_Merc%C3%AAs_Xavier
</p><p>-- <a href="User:Dria">dria</a> 08:19, 24 February 2006 (PST)
</p>
Revert to this revision