Introduction to JavaScript

C

Charlene Russ

Learn on-line at your own in a user-centered format with plenty of
interaction and personal attention.

This is a basic level coursed designed to introduce the novice to
intermediate computer user to the JavaScript language, and focuses on
creating user interactivity on personal websites. This Object Oriented
Language is known for creating a high level of interactivity with minimal
coding, and is fairly simple to learn.

We will begin with an overview of Javascript, describe its applications and
compare it to other web programming languages. Flash integration with
Javascript will also be addressed throughout the course. Topics we will be
covering include, Incorporating Javascript into an HTML page, Simple
Scripting, Time and Date,Data Variables,Writing Output, User Prompts,
Working with images, Creative Scripting, Data Types, and Navigation with
Javascript.

Objective:
To provide the student with an enjoyable learning experience complete with
personalized instruction.

Course Requirements:

Internet and Email Access
Text Editor Such as Notepad or Textpad
Ability to send attachments,
or webspace to post assignments
Netscape 6 or later
Internet Explorer 5.5 or later

Preferred but not mandatory

HTML Editor ( *Dreamweaver MX has some nice features)
Flash 5 or Flash MX
Printer Access (printing out the lessons can be very helpful)

Introduction to JavaScript, currently only $20 per six-week session!

To enroll visit us on-line at:

The Eclectic Academy
http://www.eclecticacademy.com
'The Better Choice in On-Line Learning'
 
R

Richard Cornford

Charlene Russ said:
Learn on-line at your own in a user-centered format with
plenty of interaction and personal attention.

It is an unfortunate truth that there are many poor books and Internet
sites/pages intended to, or attempting to, teach the authoring of
JavaScript for scripting web browsers. Many of these (probably most)
promote practices that are out of date, unwise or actively harmful, and
create misconceptions, misperceptions or just omit important aspects of
the language and its application.

It is to the comp.lang.javascript newsgroup that the victims of these
"resources" often turn and, with that in mind, if c.l.j is to be used to
promote a new JavaScript course it doesn't seem unreasonable to attempt
to examine the quality of the teaching that is being offered.
This is a basic level coursed designed to introduce the
novice to intermediate computer user to the JavaScript
language,

Presumably then the intended end result is to leave the student beyond
the "intermediate" level.
and focuses on creating user interactivity on personal
websites. This Object Oriented Language is known for creating
a high level of interactivity with minimal coding, and is
fairly simple to learn.

We will begin with an overview of Javascript, describe its
applications and compare it to other web programming
languages. Flash integration with Javascript will also be
addressed throughout the course. Topics we will be covering
include, Incorporating Javascript into an HTML page, Simple
Scripting, Time and Date,Data Variables,Writing Output, User
Prompts, Working with images, Creative Scripting, Data Types,
and Navigation with Javascript.

Presumably not in that order.
Objective:
To provide the student with an enjoyable learning experience
complete with personalized instruction.

So increasing the knowledge of the student is not an objective? ;-)
Course Requirements:
Netscape 6 or later
Internet Explorer 5.5 or later

You will be covering "both browsers" then?

The Eclectic Academy
http://www.eclecticacademy.com
'The Better Choice in On-Line Learning'

An attempt to asses the value of the propose course is seriously
hindered by the fact that the only information available about the
course on the Eclectic Academy web site has already been transcribed
verbatim into the preceding post.

It might have been nice to see a representative chunk of course
material, preferably something less mundane and demonstrating some
implementation code.

However, in the absence of other sources of information (and to some
extent, in any case) any organisation purporting to provide instruction
in web authoring can reasonably be assessed by examining the
implementation of their own web site.

Though it would have been nice I did not expect the Eclectic Academy web
site HTML (and/or XHTML) to validate. I was not disappointed but
although the HTML is, in places, very bad the use of JavaScript is more
pertinent to the current subject. So, starting with the home page:-

<quote cite=" http://www.eclecticacademy.com">
<script language="JavaScript">
// -- hide from old browsers
var days = new Array(7)
days[1] = "Sun.";
days[2] = "Mon.";
days[3] = "Tues.";
days[4] = "Wed.";
days[5] = "Thur.";
days[6] = "Fri.";
days[7] = "Sat.";

var months = new Array(12)
months[1] = "January";
months[2] = "February";
months[3] = "March";
months[4] = "April";
months[5] = "May";
months[6] = "June";
months[7] = "July";
months[8] = "August";
months[9] = "September";
months[10] = "October";
months[11] = "November";
months[12] = "December";


var today = new Date()
var day = days[today.getDay() + 1]
var month = months[today.getMonth() + 1]
var date = today.getDate()

document.write(day
+ " : " + month + " " + date)
// -- end hiding
</script>
</quote>

The JavaScript comments:-
// -- hide from old browsers
- and -
// -- end hiding
- are quite unexpected because, not withstanding the questionable worth
of hiding scripts from browsers so old (pre 1996?) that they would not
suitably handle script tags, these comments will not achieve their
stated intention.

The rest of the code demonstrates an obvious misconception about
JavaScript Arrays (and how they are indexed) and the inefficient use of
the getMonth and getDay methods of the Date object to index those
Arrays.

<quote cite="http://www.eclecticacademy.com/websitedev.htm">
<script language="javascript" type="text/javascript">
if (!document.getElementById) {
document.write('<link rel="stylesheet"
href="n4.css" type="text/css">');
} else {
document.write('<link rel="stylesheet"
href="btstyle472.css" type="text/css">');
}
</script>
</quote>

A page that has no other LINK elements makes the use of CSS completely
and needlessly dependent on JavaScript and then uses object inference to
decide which style sheet to use, basing that decision on an object that
has no implied or real baring on the CSS support offered by the browser.
(This falls into the category of an utterly stupid thing to be doing
with JavaScript.)

It is also interesting to see that this page starts with:-

<quote cite="http://www.eclecticacademy.com/websitedev.htm">
<html xmlns="http://www.w3.org/1999/xhtml">
</quote>

- and then goes on to make a generally misguided (and erroneous)
impersonation of XHTML, but the link elements written into the document
by the above script are in HTML format, which is inconsistent to say the
least.

The next script on that page:-

<quote cite="http://www.eclecticacademy.com/websitedev.htm">
<script type="text/javascript">
//<![CDATA[

//Popup Window Script
//By JavaScript Kit (http://javascriptkit.com)
//JavaScript tutorials and over 400+ free scripts

function openpopup(){
var popurl="psppainting1.jpg"
winpops=window.open(popurl,"",
"width=600,height=228,status,")
}
function openpopup2(){
var popurl2="bitmapproj.jpg"
winpops=window.open(popurl2,"",
"width=410,height=307,status,")
}
function openpopup3(){
var popurl3="vectorhouse.jpg"
winpops=window.open(popurl3,"",
"width=608,height=423,status,")
}
//]]>
</script>
</quote>

- could hardly be clamed to make the best use of functions, defining
three otherwise identical functions with a hard-coded URL string value
instead of one function that took the URL as a parameter. And includes
the usual inappropriately incautious attitude towards the use of the
window.open function, not even going to the effort of verifying that the
browser in question implements that function.

In context it is not really important that the functions could error in
the face of a browser that does not implement window.open because
although the code that defines the three function is included in the
page none of the functions are used on that page. So the user is
needlessly burdened with downloading a chunk of code and the author of
the page demonstrates that they didn't really understand what they were
doing.

Those two pages seem representative of the other assessable pages on the
site.

In the absence of anything that could speak for the quality of the
JavaScript course itself I am forced to conclude that if the course
teaches/promotes the techniques, practices and coding style demonstrated
at http://www.eclecticacademy.com it would be positively harmful to
exchange money for the information it provides.

Richard.
 
C

Charlene Russ

I totally agree, that's why I use a simple user-centered approach devoted
to teaching a novice student the basics which he or she will need to move on
to a more advanced level. Unlike many professors and instructors, I have a
stake in each students success and devote all my efforts to such. The
Introductory course will provide all students with a solid logical
foundation so that they do not have difficulty when they move on to advanced
scripting technique. Also in my classes, students learn high level creative
technique using more streamlined and efficient code.

Also, yes of course I teach both browsers, I can't imagine offering an
interactive JavaScript course without doing so.

Thank you for your response. :)
 
L

Lasse Reichstein Nielsen

Please don't top post.
Also, yes of course I teach both browsers, I can't imagine offering an
interactive JavaScript course without doing so.

I think the point was that "both browsers" is a concept that should
have been dropped five years ago (or more).

First of all, there are now significantly more than two browsers (I,
for one, use Opera for all my browsing). There are browsers inside
mobile phones and PDAs, and even WebTV.

Second, and more importantly, the point should be to teach standards,
not browsers, methods, not technology. If you know the W3C DOM, then
all you need to know about, e.g., IE, is where it doesn't support it
properly, and you can write code that works in all modern browsers.

/L
 
D

Dr John Stockton

JRS: In article <[email protected]>, seen in
Also in my classes, students learn high level creative
technique using more streamlined and efficient code.

If the example quoted is typical of what you teach, ISTM unlikely that
they will do that.

You create arrays of length 7 & 12, and then assign, one by one,
elements to them that make the lengths 8 & 13.

var days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]

is much nicer. Perhaps, though, your students expect eventually to be
paid according to quantity of code and not by quality.

var days = "Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(',')

is shorter, should download time be considered worth reducing.
 
J

Janwillem Borleffs

Dr John Stockton said:
You create arrays of length 7 & 12, and then assign, one by one,
elements to them that make the lengths 8 & 13.

var days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]

is much nicer. Perhaps, though, your students expect eventually to be
paid according to quantity of code and not by quality.

IMO, this isn't where a course should start with. The first step would be to
learn how to explain what an array in JS is, the second step should teach
how to create arrays from an instance of the Array object followed by an
overview of alternative methods.

Apart from this, I think a course should not be judged by the code of the
website it is advertised on. It is well possible that the webmaster's
expertise isn't JavaScript but this doesn't mean that he or she has
followed one of the classes to gain basic knowledge.

Another thing is that it's in general not a very good idea to promote
trainings in programmer newsgroups, because a lot of programmers have the
tendency to look down on anything that doesn't follow their own pattern of
thinking. But I think by now, Charlene will realise that ;-)

Let the flaming begin....

JW
 
E

Eric Bohlman

Also, yes of course I teach both browsers, I can't imagine offering
an interactive JavaScript course without doing so.

"Both browsers"? There are at least five families of browsers in
widespread use, and within each family there's widespread variation in
their support for various host-dependent features of Javascript.
 
D

Dr John Stockton

JRS: In article <[email protected]>, seen in
news:comp.lang.javascript said:
Dr John Stockton said:
You create arrays of length 7 & 12, and then assign, one by one,
elements to them that make the lengths 8 & 13.

var days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]

is much nicer. Perhaps, though, your students expect eventually to be
paid according to quantity of code and not by quality.

IMO, this isn't where a course should start with.

This is not where the course is starting.
The first step would be to
learn how to explain what an array in JS is, the second step should teach
how to create arrays from an instance of the Array object followed by an
overview of alternative methods.

Surely one does not create an array from an instance of the Object; it
already is an array, albeit empty on creation. IMHO, where there is an
efficient way of doing something, it should be shown, although not
necessarily explained, when said something is first discussed - too many
students follow only the first method in the course or book.

Apart from this, I think a course should not be judged by the code of the
website it is advertised on. It is well possible that the webmaster's
expertise isn't JavaScript but this doesn't mean that he or she has
followed one of the classes to gain basic knowledge.

A Webmaster should be capable of accepting code from an expert; and a
teacher should be an expert in what he or she teaches, at least in all
the material that the course remit can cover. Who would buy a suit from
an ill-dressed tailor?
 
L

Lasse Reichstein Nielsen

Eric Bohlman said:
There are at least five families of browsers in widespread use,

IE, Gecko, Opera, KHTML, and ... ?
What's the fifth? (Is it for Macintosh, I don't know enough about
those?)

/L
 
E

Eric Bohlman

IE, Gecko, Opera, KHTML, and ... ?
What's the fifth? (Is it for Macintosh, I don't know enough about
those?)

Miscellaneous browsers (many of which don't support scripting, though) for
Windows and at least a couple for Macs (including the Mac version of IE,
which is a completely different product from the Windows version).
 

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,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top