Something was missing. Here I was, poring through stacks of JavaScript books and screen after screen of web sites, soaking in as much code and as many concepts as possible. But after picking up some new syntax or a slick technique from the guru de jour, I didnât know what to do with it outside the scope of the example. It was as if I had a kitchen full of ingredients, but no recipes. I had all these cool JavaScript techniques and code snippets, but I wasnât sure how to apply them to solve common web site problems. Sure, some of those books had JavaScript applications, but they werenât relevant to the Web. I mean, a blackjack game is great. So is a spreadsheet app, but Iâm not going to put those on a web site any time soon.
So here are some recipes. Not just for checking a browserâs identity or doing an image rollover, but full-blown applications that youâll actually want to use on your web site. The applications here are pretty much out of the box. You can copy them into a folder on your web server (or local computer) and run them immediately. The chapters that follow are packed with JavaScript that helps you help users perform common web tasks, such as site searching, collecting survey info, creating image rollovers, viewing online presentations, cyber shopping, and plenty more. Of course, youâll want to modify them to make them work best for you, but theyâre more or less ready to go. In addition, each application comes with a lengthy explanation so that you can check out what makes each one work.
This is not a beginnerâs book. You will not learn JavaScript here.
You will learn how to use it. You donât have to be a three-year
JavaScript veteran, but if info.replace(/</g,
"<")
, new
Image()
, and var
itemArray
=
[]
seem obscure, make sure you at least have a
JavaScript syntax book handy as you work. Try OâReillyâs
JavaScript: The Definitive Guide
,
by David Flanagan.
Get JavaScript Application Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.