Basic question for a newbie JavaScript coder

E

Eli

Hello Gurus,
Started to write a basic script in JavaScript for the very first time.

q1. Do you recommend a certain JavaScript language reference,
preferably electronic version?

q2. Do you recommend a freeware/shareware decent JavaScript editor
that has the IntelliSense feature? IntelliSense used to help me heaps
if Visual Studio in a past workplace.

q3. I faced a bit of a surprise with the Window object. The
window.print() function works fine but I did not find it in 2 book
references I have. Is this a new feature you think? That's why I wrote
"up-to-date" in q1 above.

q4. Probably a stupid question: I remember that client side
scripts/applets are not allowed to store data on the client's harddisk
but to improve the performance of a web database under my development
I'm again attracted to downloading a copy of the reference tables to
the client's harddisk. The main point is obviously to reduce traffic
on the customer's intranet and internet. Any suggestions?

Heaps of thanks gurus.

Eli
 
J

Jc

1.
http://msdn.microsoft.com/library/en-us/script56/html/js56jsoriJScript.asp

2. I just use TextPad myself.

3. The window object is part of the web browser's Document Object Model
(DOM) that is accessible through javascript. However, it has nothing to
do with the actual language, which is why it wasn't mentioned. In
addition to the previous link for the javascript reference, you'll want
to use it in combination with the following link which documents the
DOM (which you can access using javascript).
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp

4. Consider your client to be a "thin-client", if you're implementing
it in javascript, you don't have the luxury of being able to cache
things like a "thick-client" win32 application could. There are many
things you can do to improve performance, but without being more
familiar with your project I don't have anything specific to suggest.

Note that I work exclusively with Internet Explorer 5 and higher, so
the links I've posted are a bit biased as they document things that may
not work in other browsers. Depending on your target audience's
computers, you may want to find references that aren't IE specific.
 
F

Fred Oz

Jc said:

Or:

http://www.mozilla.org/js/language/

For other stuff, try:

http://www.mozilla.org/docs/web-developer/#scripting

which also has references for HTML, XML, CSS, etc.

2. I just use TextPad myself.

TextEdit is pretty handy shareware and good value at $US 30 for a
single user licence (the demo never expires, it just bugs you to
register after 30 days).
3. The window object is part of the web browser's Document Object Model
(DOM) that is accessible through javascript. However, it has nothing to
do with the actual language, which is why it wasn't mentioned. In
addition to the previous link for the javascript reference, you'll want
to use it in combination with the following link which documents the
DOM (which you can access using javascript).
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp

Mozilla's DOM reference can be found at:

http://www.mozilla.org/docs/web-developer/
 
M

Michael Winter

q1. Do you recommend a certain JavaScript language reference, preferably
electronic version?

The only language reference that hasn't been mentioned so far is ECMA-262,
the ECMAScript standard. Whilst it is the definitive reference for the
language, it's not the easiest thing to read by any means. You can find a
link to it in the online resources section of the FAQ
(<URL:http://jibbering.com/faq/>).

The references for DOM 1 and 2 can be found on the W3C web site
q2. Do you recommend a freeware/shareware decent JavaScript editor that
has the IntelliSense feature? IntelliSense used to help me heaps if
Visual Studio in a past workplace.

It isn't really possible to provide IntelliSense for Javascript.
Javascript is a loosely typed language, so a variable that at one point
contained a string, could contain an object later. But more than that,
there are few object members that you can guarantee will exist in all user
agents; another difference with regard to strictly typed languages.
q3. I faced a bit of a surprise with the Window object. The
window.print() function works fine but I did not find it in 2 book
references I have. Is this a new feature you think? That's why I wrote
"up-to-date" in q1 above.

No it's not new, but the window object is not part of the language. It's
part of the "Level 0" Document Object Model - the de facto standard for
basic scripting support in browsers.
q4. Probably a stupid question: I remember that client side
scripts/applets are not allowed to store data on the client's harddisk
but to improve the performance of a web database under my development
I'm again attracted to downloading a copy of the reference tables to the
client's harddisk. The main point is obviously to reduce traffic on the
customer's intranet and internet. Any suggestions?

The only reasonably (but not totally) reliable client-side storage method
is the cookie, which has very restrictive size limits.

Mike
 
H

Howard Kaikow

Fred Oz said:
TextEdit is pretty handy shareware and good value at $US 30 for a
single user licence (the demo never expires, it just bugs you to
register after 30 days).


If you have VS NET installed, give the file a .js extension, right clisk,
and open in .NET.
Gives you access to the Jscript, etc. online help and intellisense stuff
in.NET.
 
H

Howard Kaikow

Michael Winter said:
It isn't really possible to provide IntelliSense for Javascript.
Javascript is a loosely typed language, so a variable that at one point
contained a string, could contain an object later. But more than that,
there are few object members that you can guarantee will exist in all user
agents; another difference with regard to strictly typed languages.

If you have .NET installed, see my other posting in his thread.
 
M

Michael Winter

If you have .NET installed, see my other posting in his thread.

I do. It doesn't change the fact that Javascript is not suitable for
IntelliSense. That said, I suppose Microsoft assume information about
their own browsers.

Mike
 
R

Richard Cornford

Howard said:
If you have .NET installed, see my other posting in his thread.

But IntelliSense for Windows IE (even Windows + Mac IE) is likely to be
actively harmful in cross-browser scripting. And IntelliSense for
ECMAScript (of which JScript is an implementation) is not that useful
for exactly the reasons Mike outlined above. In a language with only one
Object type, and where functions are of that type, how can a machine
reading source code hop to distinguish between a function object that is
a "class" constructor and a function object that is a "class" instance?
Could it hope to recognise inheritance through the prototype alongside
inheritance through augmentation (and multiple inheritance through the
combination of both, or just the latter)?

Richard.
 
E

Eli

Thank you very much all for your contributions and the great discussion.
I'll go after each sugestion.
Kind regards,
Eli
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top