HTML5, CSS3, and JavaScript Fourth Edition

(Ben Green) #1

CHAPTER 14. JAVASCRIPT AND AJAX 147


AJAXgives you the ability to send and receive information without waiting
for the submit button to be pressed.


14.1 Yikes! Programming?


JavaScript is a programming language, but most web designers let somebody
else do all the programming. They just insert some “canned” routines into
their webpages.


That is the level of skill you must attain.


To do that, you must understand enough JavaScript to read it at an intro-
ductory level, and to make simple changes to it when needed.


If you happen to also be a programmer, yay. But this book will barely skim
the surface of JavaScript programming. This chapter is JavaScript for Web
Designers, not JavaScript for Programmers.


There is a very large body of free JavaScript code available on the Internet.
You can find online various snippets of JavaScript that you can include
in your webpages. Others have written them so you do not need to be a
programmer. But you need to know how to insert them into your webpage
properly. Google search “free javascript code” for many examples.


For now, just breathe deeply and relax.


14.2 What can JavaScript Do?


You probably use JavaScript-based websites everyday. Web-based email is
all about JavaScript. News websites are literally infested with JavaScript.
Facebook and other websites use JavaScript to continually load new content
as you scroll your screen.


More? One of the most common uses of JavaScript is the (more) option
you commonly see after the first few lines of some content. We know that
users only read the first line or two and then skip on to the next item. Once
in a while they are interested and want to see more. JavaScript lets them
click on a (more) link that reveals the rest of the content, and a (less) link
that hides it again.

Free download pdf