Tuesday, October 16, 2018

Java is to JavaScript what Car is to Carpet

Why Use JavaScript If It Cannot Be Relied On?

As I just mentioned, just because it may not always be available doesn’t mean that JavaScript
shouldn’t be used at all. It should simply not be the only means of user interaction.
The merits of using JavaScript are
• Less server interaction: You can validate user input before sending the page off to the
server. This saves server traffic, which means saving money.
• Immediate feedback to the visitors: They don’t have to wait for a page reload to see if
they have forgotten to enter something
• Automated fixing of minor errors: For example, if you have a database system that
expects a date in the format dd-mm-yyyy and the visitor enters it in the form dd/mm/yyyy,
a clever JavaScript script could change this minor mistake prior to sending the form to the
server. If that was the only mistake the visitor made, you can save her an error message—
thus making it less frustrating to use the site.
• Increased usability by allowing visitors to change and interact with the user interface
without reloading the page: For example, by collapsing and expanding sections of the
page or offering extra options for visitors with JavaScript. A classic example of this would
be select boxes that allow immediate filtering, such as only showing the available destinations
for a certain airport, without making you reload the page and wait for the result.
• Increased interactivity: You can create interfaces that react when the user hovers over
them with a mouse or activates them via the keyboard. This is partly possible with CSS
and HTML as well, but JavaScript offers you a lot wider—and more widely supported—
range of options.
• Richer interfaces: If your users allow for it, you can use JavaScript to include such items
as drag-and-drop components and sliders—something that originally was only possible
in thick client applications your users had to install, such as Java applets or browser
plug-ins like Flash.
• Lightweight environment: Instead of downloading a large file like a Java applet or a
Flash movie, scripts are small in file size and get cached (held in memory) once they
have been loaded. JavaScript also uses the browser controls for functionality rather than
its own user interfaces like Flash or Java applets do. This makes it easier for users, as they
already know these controls and how to use them. Modern Flash and Macromedia Flex
applications do have the option to stream media and—being vector based—are visually
scalable, something JavaScript and HTML controls aren’t. On the other hand, they
require the plug-in to be installed.

Christian Heilmann
Foreword by Simon Willison,
Technology Development at Yahoo!


***



There has never been a more exciting time to learn JavaScript. It may be a cliché, but it’s
certainly true. After years spent banished in a wilderness of browser wars and false promises,
JavaScript has finally emerged as an essential part of any web developer’s toolbox. No longer
just a vehicle for ads and annoyances, it is now a valuable component of the next generation of
web applications.

What has caused this sudden rush of interest? The first reason is purely practical: browser
improvements have finally made it viable to write cross-browser JavaScript with some certainty
that it will actually work. The second is more revolutionary: Ajax, an old technique with a new
name that enables client-side code to communicate directly with a server without refreshing
the whole page. This simple ability has thrown web application development wide open,
enabling new, innovative interfaces and dramatically altering user expectations of how web
interfaces can behave.

This adoption has been helped by the growing realization that JavaScript is not a toy
language. 

Despite its numerous warts, beneath its deceptively simple exterior lie a host of
powerful features not seen in many mainstream languages: closures, prototypal inheritance,
and extensive support for the functional programming style. That such a flexible language is
now installed on hundreds of millions of computers is a cause for celebration in itself.

Just because you can do something doesn’t mean that you should. Not all browsers are
born equal, and accessibility (both for people and for alternative devices) remains an essential
aspect of developing for the Web. Understanding the issues and techniques around progressive
enhancement is an important part of the JavaScript learning curve.

The set of challenges posed by JavaScript development is huge.

Browsers frequently deviate from what standard specifications there are, and pseudostandards
are common and frequently unavoidable.

Ambitious new applications are uncovering browser bugs that have laid dormant for years.

The complexity of those applications is itself a problem, introducing new problems related to
maintaining large code bases.

Thankfully, the global JavaScript community has risen to the challenge. A wealth of
code and resources awaits the intrepid developer, but the value of this treasure trove can be
unlocked only through a solid understanding of the underlying platform. This book will provide
you with that knowledge.

As a long-standing teacher and leader in that community, Christian is the ideal guide to
this intricate world. This book comprises accumulated wisdom obtainable only through years
of experience.

Christian will teach you to apply JavaScript tastefully, responsibly, and elegantly in a way
that will delight your users and impress your peers.

Simon Willison

Technology Development at Yahoo!



The different layers of web development

• The behavior layer: Is executed on the client and defines how different elements behave
when the user interacts with them (JavaScript or ActionScript for Flash sites).

• The presentation layer: Is displayed on the client and is the look of the web page (CSS,
imagery).

• The structure layer: Is converted or displayed by the user agent. This is the markup
defining what a certain text or media is (XHTML).

• The content layer: Is stored on the server and consists of all the text, images, and multimedia
content that are used on the site (XML, database, media assets).

• The business logic layer (or back end): Runs on the server and determines what is done
with incoming data and what gets returned to the user.



PREDIVAN ODLOMAK IZ KNJIGE:


Beginning JavaScript
with DOM Scripting
and Ajax
From Novice to Professional
■ ■ ■
Christian Heilmann

Ono što mnogi previde je da JavaScript funkcioniše prvenstveno na klijentskom kompjuteru u browseru, ali mnogi ne znaju da postoji verzija ovog jezika koja radi na serveru i u poslednje vreme su ovi programeri posebno traženi (Vue, REACTJS, Angular...)

Ukoliko Vi imate da reklamirate neki svoj proizvod ili slične sadržaje, blogove, knjige i sajtove slobodno me kontaktirajte.



***



No comments:

Post a Comment

Коментар: