Awesome Tutorials for JavaScript beginners

D

David Mark

Not so awesome. I stopped reading after this:

"Browsers that do not support JavaScript

"If a browser do not support Javascript, it will display the
whole content of the javascript that is written between <script>
and</script>. To prevent this an HTML comment tag <!-- just
before the first JavaScript statement, and a --> (end of
comment) after the last JavaScript statement is added ..."

After this I'm not so sure they know about what they are
writing. Show me a browser that doesn't know the script tag.

The article is a reprint from 1997 apparently. :)
 
T

Thomas 'PointedEars' Lahn

David said:
The article is a reprint from 1997 apparently. :)

I presume, since I had only begun Web-authoring at the time, that even in
1997 Web browsers were not this borken to display the content of
unrecognized SCRIPT elements when within the HEAD element. So, IMHO, if
this recommendation had ever made sense in the past (before HTML 3.2), it
would only have made sense for SCRIPT elements within the BODY element.


PointedEars
 
J

John G Harris

Hello fellow members, I found a great blog on tutorials for
Javascript,

There are examples, illustrative code samples and user feedbacks for
different posts.

http://www.ezdia.com/Javascript_Tutorial/Content.do?id=653


IE8 says javascript error on every page. That doesn't inspire confidence
in the authors.


The first page says
"Java is coded in a similar fashion to C++, with separate header
and class files" ...

which is wildly untrue.


If-else is shown as
if (condition)
{
code to be executed; //if condition is true
}
else
{
code to be executes; // if condition is false
}

with no indentation and always with curly brackets. Oh Dear, Oh Dear.
Presumably the reader is expected to cope with the typing errors.

John
 
E

Esa

The first sample I had a look at this book.

"
While Loop

The JavaScript while loop consists of a condition and the statement
block.

while (condition)
{
...statements...
}


The condition is evaluated. If the condition is true the statements
are evaluated. If the statement is false we exit from the while loop.
"


The series of books "Bullshit about JavaScript" still continues. I
thought that Flanagan made the end to the series.
 
J

John G Harris

The first sample I had a look at this book.

"
While Loop

The JavaScript while loop consists of a condition and the statement
block.
^^^^^
A lie.
while (condition)
{
...statements...
}


The condition is evaluated. If the condition is true the statements
are evaluated. If the statement is false we exit from the while loop.
^^^^^^^^^
Yet another typing error, probably.
"


The series of books "Bullshit about JavaScript" still continues. I
thought that Flanagan made the end to the series.

And another thing. Why does it take over half a megabyte of javascript
to display a page of tutorial text ?

John
 
D

David Mark

 ^^^^^
 A lie.



                       ^^^^^^^^^
Yet another typing error, probably.



And another thing. Why does it take over half a megabyte of javascript
to display a page of tutorial text ?

1. Most Web developers (and their managers) think browser scripting is
impossible (aw jeez, browsers are too buggy!)

2. These same people think that anybody who posts a JS library must be
an expert and they should put all of their faith into these Other Guy
(s) (AKA Ninjas).

3. They don't know or care how much their pages weigh, how slowly they
load or how many hapless users they've excluded. As long as it looks
good to them on their PC(s) (in the latest browsers), they figure they
have a pat hand.

It's getting worse now that IE8 is out, making it trivially easy to
write an app that "works" in IE8, but falls apart in IE < 8 (or in
compatibility mode). The "answer" for some is to exhort their users
to download FF (it's free after all!)

This site throws several exceptions off the bat in IE8 (and < 8 of
course) in any mode. They are using something called "Agile Ajax".

Copyright (c) 2007 Brian Dillard and Brad Neuberg:
Brian Dillard | Project Lead | (e-mail address removed) | http://blogs.pathf.com/agileajax/
Brad Neuberg | Original Project Creator | http://codinginparadise.org

Two guys who should have found another hobby.

window.dhtmlHistory = {

Of course. Everyone wants to write single-page sites. Or they did in
2007 anyway. ;) And why is this added to the window object?


/*Public: User-agent booleans*/
isIE: false,
isOpera: false,
isSafari: false,
isKonquerer: false,
isGecko: false,
isSupported: false,


....

var that = this;

/*set user-agent flags*/
var UA = navigator.userAgent.toLowerCase();
var platform = navigator.platform.toLowerCase();
var vendor = navigator.vendor || "";
if (vendor === "KDE") {
this.isKonqueror = true;
this.isSupported = false;
} else if (typeof window.opera !== "undefined") {
this.isOpera = true;
this.isSupported = true;
} else if (typeof document.all !== "undefined") {
this.isIE = true;
this.isSupported = true;

Sure. Anything with document.all is IE (and always will be).


} else if (vendor.indexOf("Apple Computer, Inc.") > -1) {
this.isSafari = true;
this.isSupported = (platform.indexOf("mac") > -1);
} else if (UA.indexOf("gecko") != -1) {
this.isGecko = true;
this.isSupported = true;
}

/*Add an unload listener for the page; this is needed for FF 1.5+
because this browser caches all dynamic updates to the
page, which can break some of our logic related to testing whether
this is the first instance a page has loaded or whether
it is being pulled from the cache*/

var unloadHandler = function() {
that.firstLoad = null;
};

this.addEventListener(window,'unload',unloadHandler);

In other words, their design is backwards and their implementation
incompetent. God only knows what the rest of the half meg holds.

I wonder who will go back and rewrite all of these dump sites? How
can developers think they are saving time by dumping every script they
can find into a site, no matter how dubious or inexplicable? If they
didn't understand them when the site was built, what will they do when
it breaks? I suppose they could contact the authors of the script
(s). But those are the people who caused the problems in the first
place. Maybe they have a clue two years later, but I can't see
counting on that. Or perhaps they can get an answer from their
similarly confused colleagues in the library "community". I'm sure
they'll know just what to do (upgrade dude, the _next_ version is
awesome!) ;)
 
D

David Mark

ankit agarwal schreef:



Nice attempt, but you have a LONG way to go,
to get better than:http://www.w3schools.com/js/default.asp

From their "How to write HTML tags" example:-
<html>
<body>

<script type="text/javascript">
document.write("<h1>Hello World!</h1>");
</script>

</body>
</html>

I find it odd that a first document.write example would botch
document.write. But I half-expected to see something like:-

<html>
<body>

<script type="text/javascript">

// WRONG

document.write("<h1>Hello World!</" + "h1>");
</script>

</body>
</html>

From the "Use a for...in statement to loop through the elements of an
array":-

<html>
<body>
<script type="text/javascript">
var x;
var mycars = new Array();
mycars[0] = "Saab";
mycars[1] = "Volvo";
mycars[2] = "BMW";

for (x in mycars)
{
document.write(mycars[x] + "<br />");
}
</script>
</body>
</html>

The XHTML BR is priceless. :)
Which i use when i need a tutorial for javascript

It's not as if it is outdated. This was never any good. Avoid at all
costs unless you want to end up like the authors. ;)
 
D

Dr J R Stockton

In comp.lang.javascript message <f18270ec-5eaf-4595-9dd1-da78e5fd5c02@v1
9g2000vbk.googlegroups.com>, Mon, 7 Dec 2009 03:56:07, David Mark
I find it odd that a first document.write example would botch
document.write. But I half-expected to see something like:-

<html>
<body>

<script type="text/javascript">

// WRONG

document.write("<h1>Hello World!</" + "h1>");
</script>

</body>
</html>

You should clarify your objection in words. In this case, it's not
clear whether you object to substring </H1> in a string, preferring
perhaps to use DOM methods at this stage); and it's not clear why you
seem not to expect, instead of 'World!</" + "h1>"', 'World!<\/h1>"'.
 
D

David Mark

In comp.lang.javascript message <f18270ec-5eaf-4595-9dd1-da78e5fd5c02@v1
9g2000vbk.googlegroups.com>, Mon, 7 Dec 2009 03:56:07, David Mark
<[email protected]> posted:









You should clarify your objection in words.

Not mime?
In this case, it's not
clear whether you object to substring </H1> in a string, preferring
perhaps to use DOM methods at this stage); and it's not clear why you
seem not to expect, instead of 'World!</" + "h1>"', 'World!<\/h1>"'.

I am not objecting to using document.write in a document.write example
(I think I made that clear). I would have excepted the concatenation
because that's a common magic spell used to "fix" the problem. Why
should I have expected the right answer from such a bad tutorial?
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top