| | | FAQ server |  |
| Posted: Wed Sep 03, 2008 6:00 am Post subject: comp.lang.javascript FAQ - META 2008-09-03 |  |
| |  | |
comp.lang.javascript FAQ - META - 9.91 - 2008-01-19
1 meta-FAQ meta-questions 2 comp.lang.javascript tips 2.1 Which newsgroups deal with javascript? 2.2 What questions are off-topic for clj? 2.3 What do I have to do before posting to clj? 2.4 Why was my post not answered? 2.5 How do I direct someone to this FAQ? 2.6 What is ECMAScript? 2.7 What is JScript? 2.8 What are object models? 2.9 What is the document object model? 2.10 Internationalization and Multinationalization in javascript. 2.11 I have a question that is not answered in here or in any of the resources mentioned here but I'm sure it has been answered in clj. Where are the clj archives located? 2.12 What does the future hold for ECMAScript? 3 javascript resources 3.1 What books cover javascript? 3.2 What online resources are available? 4 Quick Answers 4.1 How do I protect my javascript code? 4.2 How can I disable the back button in a web browser? 4.3 How can I access the client-side filesystem? 4.4 How can I see in javascript if a web browser accepts cookies? 4.5 How can I prevent access to a web page by using javascript? 4.6 How do I convert a Number into a String with exactly 2 decimal places? 4.7 Why does simple decimal arithmetic give strange results? 4.8 How do I communicate between frames in a web browser? 4.9 How do I find the size of the window/browser canvas area? 4.10 How do I check to see if a childwindow is open, before opening another? 4.11 Why does framename.print() not print the correct frame in IE? 4.12 Why does K = parseInt('09') set K to 0? 4.13 How do I get the value of a form control? 4.14 How do I close a window and why does it not work on the first one? 4.15 How do I modify the current page in a browser? 4.16 How do I trim whitespace - trim/trimRight/trimLeft 4.17 How do I force a reload from the server/prevent caching? 4.18 How do I get a perl/asp/php variable into client-side js? 4.19 Why do I get permission denied when accessing a frame/window? 4.20 How do I make a 10 second delay? 4.21 Why does 1+1 equal 11? or How do I convert a string to a number? 4.22 How do I generate a random integer from 1 to N? 4.23 How do I change print settings with window.print()? 4.24 I have <a href="javascript:somefunction()"> what ... ? 4.25 My element is named myselect[] , how do I access it? 4.26 How do I detect Opera/Netscape/IE? 4.27 How do I disable the right mouse button? 4.28 How do I change the confirm box to say yes/no or default to cancel? 4.29 How do I log-out a user when they leave my site? 4.30 How do I format the Last-Modified date with javascript? 4.31 Why are my rollovers so slow? 4.32 How do I change the text in the url/location bar? 4.33 How do I prompt a "Save As" dialog for an accepted mime type? 4.34 How do I run a server side script? 4.35 I have window.status="Moomin"; why doesn't the statusbar change? 4.36 How do I modify the current browser window? 4.37 How do I POST a form to a new window? 4.38 How do I download a page to a variable? 4.39 How do I access a property of an object using a string? 4.40 When should I use eval? 4.41 Why doesn't the global variable "divId" always refer to the element with id="divId"? 4.42 How do I open a new window with javascript? 4.43 How do I get my browser to report javascript errors? 4.44 What is AJAX? 4.45 Why is my AJAX page not updated properly when using an HTTP GET request in Internet Explorer? 5 Comments and Suggestions 5.1 Why do some posts have <FAQENTRY> in them ? 5.2 How do I make a suggestion?
1 meta-FAQ meta-questions
You are reading the _comp.lang.javascript_ meta-FAQ, version 9.91. It is available on the web at <URL: LINK > in HTML form. This is the official _comp.lang.javascript_ (clj) FAQ. Or, more accurately, the meta-FAQ. It mainly provides URLs to further information about javascript, and some hints and tips to make your stay in comp.lang.javascript more enjoyable. This document was created for three reasons: to help reduce the high levels of noise on clj, to provide a resource for people new to javascript, and to point to locations that contain valuable javascript resources. Each day, one section of the FAQ is posted for review and questions, and as a reminder that the FAQ is available. To cope with a desire for additional explanation and detail relating to some aspects of the FAQ, an additional resource is available at:-
<URL: LINK >
It has been provided separately to avoid increasing the size of the FAQ to a point where it would be unreasonable to post it to the group.
2 comp.lang.javascript tips 2.1 Which newsgroups deal with javascript?
The official Usenet newsgroup dealing with javascript is news:comp.lang.javascript. There are other newsgroups but many of them are not carried by most news feeds. clj is an unmoderated newsgroup.
2.2 What questions are off-topic for clj?
The comp.lang.javascript newsgroup deals with ECMAScript languages, so any questions about JavaScript or JScript are welcome. However, the majority of questions sent to this group relates to javascript in a web browser. If you are experiencing issues with a particular browser, or the host is not a browser at all, please make this information clear. Javascript and Java are two completely different languages. Java questions should be asked in one of the comp.lang.java.* newsgroups; they are not appropriate for clj (as Java and javascript are distinct programming languages with only superficial similarities due to sharing a C-like syntax and some of the characters in their names). Questions dealing with other scripting languages, such as VBScript, PerlScript or CGI scripting are also off-topic, as are HTML-only or CSS-only questions. Questions that are specific to Microsoft's JScript may also be appropriately asked at: news:microsoft.public.scripting.jscript The comp.lang.javascript newsgroup charter is included in <URL: LINK >
2.3 What do I have to do before posting to clj?
Before posting to clj, you should thoroughly read this document. You should also check the resources mentioned in section 3 and the Quick Answers in section 4. Read FYI28/RFC1855 <URL: LINK > on Usenet and <URL: LINK >. Also you should read all appropriate posts to the clj newsgroup for several days. Most questions come up at least once every other day and people can get annoyed of answering them repeatedly. Please state your question as clearly and concisely as possible, as this will make it far easier for the other readers of the group to understand your problems and suggest possible solutions. Use the Subject: of your post to indicate the type of problem you have, but include the question in the body as well. 'Help!' or 'I hate Netscape!' are not nearly as useful to contributors who do not read every post as 'parseInt("09")!=9'. Has the same question already been posted that day? - if it has wait to see if the answers to that solve your problem. Include the script you have been working on (or URL) - indicate the problem spots and/or previous attempts. Try to limit the length of your post by removing extraneous page elements, but avoid removing script unless you are sure it is not an issue. If the script is long though, please do not post the full script and just provide a link. As a guide more than 500 lines for a post is not normally a good idea in any circumstances. A mention of which platforms and browsers are used or are giving problems is also necessary. Post in plain-text only. Do not post using HTML. If you have to include your script, paste it in to your post in plain-text. Do not uuencode it or attach it using MIME. There is good reason for this request: many newsreaders do not read HTML or MIME, and this limits the number of people who could help you. Test posts belong in test newsgroups (they have "test" in their names). Make sure your code is executable as transmitted. Use line breaks to keep the posting agent from wrapping code incorrectly. When replying to a message on the group quote the minimum of the preceding messages that is sufficient to provide context for the reply but trim the remainder, and add your comments below the pertinent section of quoted material, as per FYI28/RFC1855 (never top post). Don't ask, or at least expect, to be emailed individually. Some individuals run scams for the purpose of collecting active email addresses and many won't risk being victimized. If you have circumstances that won't allow you to read clj for the follow-up, explain what they are and ask to be CC'ed a copy. You also might try <URL: LINK > to read replies. Don't expect to be able to e-mail contributors to the group privately. E-mail addresses are often obscured, fictional or unmonitored spam sinks (this is an increasingly normal (and even unofficially recommended) practice as open e-mail addresses in news articles will be both the target of spam and used as fake sender's addresses in spam to third parties). Don't take flames too seriously, and don't start a thread complaining about rude or flippant responses. There is already enough noise in clj. Keep a sense of humour while posting and reading and everything will be a lot more enjoyable. Remember that it is _not_ the _job_ of posters here to help you. The majority of regular posters here do so _voluntarily_ in their free time. They have good days and bad days just like everyone else. clj is a technical group: the posting of job adverts and commercial adverts are not welcome. Job postings should go to an appropriate regional jobs group. Announcements of products of particular relevance to javascript are welcome, but not more often than once per major release, and then post a short link to the product's webpage. Please do not post copyrighted material to clj without permission from the copyright holder.
2.4 Why was my post not answered?
This could be for several reasons:
It was a variation of a frequently asked question and was therefore ignored by everyone. Nobody knows the answer. The person with the answer has not seen the post. It might not be possible to do what you want to do but perhaps readers of clj are reluctant to answer your post in the negative when they are not convinced that it cannot be done. The question was not asked clearly enough, or did not included enough information to be answered. The questioner did not realise the need to read the group, for a few days, to see the answers posted there.
If it is not one of these, then after a few days consider reposting after checking <URL: LINK > for replies. Make sure the post is phrased well, and everything needed to answer is correct, and the subject is appropriate.
2.5 How do I direct someone to this FAQ?
This document is posted to clj very frequently. There should be no reason to direct someone to it. However, if someone asks a question answered in this FAQ or in one of the resources listed herein, please let them know their question is answered in the FAQ and that the FAQ can be found at <URL: LINK >
2.6 What is ECMAScript? <URL: LINK > ECMAScript is the international standard for javascript. JScript 3.0 and JavaScript 1.2 (available with version 4. browsers) are more or less ECMAScript compliant. In addition ECMA 327 defines the Compact Profile of ECMAScript by describing the features from ECMA 262 that may be omitted in some resource-constrained environments. Note that ECMAScript did not attempt to standardize the document object model. The current edition is ECMA-262, 3rd Edition. There is some support for this edition in JScript 5.0 and JavaScript 1.3. JScript 5.5 and JavaScript 1.5, in Netscape 6.1 and later, are compliant (JavaScript 1.5 in Netscape 6 missed some methods).
2.7 What is JScript?
JScript is Microsoft's implementation of ECMAScript. Questions that are specific to Microsoft's JScript may also be appropriately asked at: news:microsoft.public.scripting.jscript
2.8 What are object models? Object models (OMs) are not part of the javascript language: they are provided by the host to allow javascript (or other scripting language) to communicate with the host. An object model may allow javascript to access a file system, or control a nuclear power station. The most commonly used object models via javascript are provided by Active Server Pages, Server Side JavaScript, and the Windows Script Host. The most common of all is the Document Object Model (DOM) provided by web browsers. Other document types such as SVG also define scriptable DOMs, mostly as extensions of the W3C Core DOM specification designed for use with XML documents.
2.9 What is the document object model?
This is the collection of objects provided by each browser. Basically, any object in the window hierarchy is part of the DOM. This means that document.writeln(), for example, is not a javascript method but is, in fact, a method provided by the DOM. The DOM has been standardised by the World Wide Web Consortium (W3C); however, like all W3C standards, browser support is not yet complete. Most cross-browser coding problems come from slightly different implementations of the DOM in the different browsers. W3 DOM FAQ <URL: LINK > The W3C has worked on three versions of the DOM to date. The third version has not yet achieved the status of a recommendation <URL: LINK >.
2.10 Internationalization and Multinationalization in javascript.
Internationalisation means using one form which is everywhere both acceptable and understood. Any international standard not supported by default can be coded for. For example, there is an International Standard for numeric Gregorian date format; but none for decimal and thousands separators. Multinationalisation means using different forms for different readers. It cannot work well in general, because it requires a knowledge of all preferences and the ability to choose the right one, in an environment where many systems are inappropriately set anyway. JavaScript has a few Multinationalisation features. The various toString() methods are all implementation dependent, but tend to use either UK or US settings (not necessarily correctly). ECMAScript Ed. 3 introduced some capabilities, including the toLocaleString() method which should create a string based on the host's locale. Much more support is expected in future versions of JavaScript.
2.11 I have a question that is not answered in here or in any of the resources mentioned here but I'm sure it has been answered in clj. Where are the clj archives located? <URL: LINK > Maintain an archive of comp.lang.javascript going back to 1996 and provide diverse archive searching facilities.
2.12 What does the future hold for ECMAScript?
The ECMAScript Technical Committee is now working on the fourth edition, the first implementation of which is JScript.NET. It includes a compiler, allowing you to create standalone JScript executables. The fourth edition of ECMAScript will provide new features like typed variables, and classes. More information can be found at: <URL: LINK >, or from news:microsoft.public.dotnet.languages.jscript
3 javascript resources 3.1 What books cover javascript?
Most clj regulars believe the best book to be: JavaScript: The Definitive Guide, 5th Edition By David Flanagan ISBN:0-596-10199-6 The errata should be considered a must read along with the book. <URL: LINK >
Errata: <URL: LINK >
3.2 What online resources are available? The official ECMAScript specification:- <URL: LINK > Other versions of the ECMAScript specification:- <URL: LINK > DOM level 1 ECMA script binding:- <URL: LINK > DOM level 2 ECMA script binding:- <URL: LINK > Mozilla JavaScript 1.5 reference:- <URL: LINK > Online Gecko DOM Reference:- <URL: LINK > Download:- <URL: LINK > Microsoft (D)HTML reference:- <URL: LINK > JScript reference and main Microsoft script site:- <URL: LINK > <URL: LINK > Opera Documentation:- <URL: LINK > <URL: LINK > ICab's Inscript documentation:- <URL: LINK > Frequently asked questions about source code obfuscation:- <URL: LINK > Venkman - Mozilla Visual JS debugger:- <URL: LINK > Firebug extension for Firefox:- <URL: LINK > Index of Netscape 4 JavaScript docs online (These documents are no longer available form Netscape but are still reproduced by Sun Microsystems, Inc.):- <URL: LINK > Index of Archived Netscape 4 JavaScript docs online and for download:- <URL: LINK > Archived documentation for MSIE 3.x:- <URL: LINK > Javascript FAQ site:- <URL: LINK > FESI - a free implementation of ECMAScript in Java:- <URL: LINK > Sites discussing Active Server Pages:- <URL: LINK > <URL: LINK > <URL: LINK > DHTML source code and tutorials:- <URL: LINK > Sites focused on using Scripting to automate Windows:- <URL: LINK > <URL: LINK > Microsoft's Windows Scripting Host (WSH) Newsgroup:- Microsoft's JScript Newsgroup:- Whitebeam Apache Module - Server Side Javascript in Apache;- <URL: LINK > Digital Mars DMD Script, console and MS Active Script implementation of ECMAScript, claimed to be faster than other implementations:- <URL: LINK >
4 Quick Answers
see <URL: LINK > Or Mondays FAQ posting.
5 Comments and Suggestions 5.1 Why do some posts have <FAQENTRY> in them ?
If a poster feels that the question they are answering should be covered in the FAQ, placing <FAQENTRY> in your post lets the FAQ robot collect the messages for easy review and inclusion. A Draft Proposal for the FAQ is requested and appreciated. The <FAQENTRY> should not be used in posts except in conjunction with a suggestion/proposal for the FAQ. It should also not be literally quoted in replies, instead it should be partly obscured as, e.g. <FAQ**TRY> or similar.
5.2 How do I make a suggestion?
To make a suggestion to the FAQ, use either the FAQENTRY method above, or email Randy Webb (cljfaq@comcast.net) (current FAQ editor) or Jim Ley (jim.ley@gmail.com). All comments, suggestions, and especially corrections are welcome. Any email sent to cljfaq@comcast.net that does not contain FAQENTRY in the subject line is summarily deleted by my spam filter. |
|