ASmarter Way
To Learn jQuery
Learnit faster. Remember it longer.
Mark Myers
Copyright 2015 Mark Myers
All rights reserved, including the right to reproduce this book, or anyportions of it, in any form.
1.1
http://www.ASmarterWayToLearn.com
Contents
Learn it faster.
Remember it longer.
If you embrace this method oflearning, youll get the hang of jQuery in less time than you mightexpect. And the knowledge will stick.
Youll catch onto concepts quickly.
Youll be less bored, and mighteven be excited. Youll certainly be motivated.
Youll feel confident instead offrustrated.
Youll remember the lessons longafter you close the book.
Is all this too much for a book topromise? Yes, it is. Yet I can make these promises and keep them,because this isnt just a book. Its a book plus 1,500 interactiveonline exercises. Ive done my best to write each chapter so its easyfor anyone to understand, but its the exercises that are going to turnyou into a real jQuery coder.
Cognitive research shows thatreading alone doesnt buy you much long-term retention. Even if youread a book a second or even a third time, things wont improve much,according to research.
And forget highlighting orunderlining. Marking up a book gives us the illusion that wereengaging with the material, but studies show that its an exercise inself-deception. It doesnt matter how much yellow you paint on thepages, or how many times you review the highlighted material. By thetime you get to Chapter 50, youll have forgotten most of what youhighlighted in Chapter 1.
This all changes if you read lessand do moreif you read a short passage and then immediately put itinto practice. Washington University researchers say that being askedto retrieve information increases long-term retention by four hundredpercent. That may seem implausible, but by the time you finish thisbook, I think youll believe it.
Practice also makes learning moreinteresting.
Trying to absorb long passages oftechnical material puts you to sleep and kills your motivation. Tenminutes of reading followed by twenty minutes of challenging practicekeeps you awake and spurs you on.
And it keeps you honest.
If you onlyread, its easy to kid yourself that youre learning more than you are.But when youre challenged to produce the goods, theres a moment oftruth. You know that you knowor that you dont.When you find out that youre a little shaky on this point or that, youcan review the material, then re-do the exercise. Thats all it takesto master this book from beginning to end.
Ive talked with many readers whosay they thought they had a problem understanding technical concepts.But what looked like a comprehension problem was really a retentionproblem. If you get to Chapter 50 and everything you studied in Chapter1 has faded from memory, how can you understand Chapter 50, whichdepends on your knowing Chapter 1 cold? The read-then-practice approachembeds the concepts of each chapter in your long-term memory, so youreprepared to tackle material in later chapters that builds on top ofthose concepts. When youre able to remember what you read, youll findthat you learn jQuery quite readily.
I hope you enjoy this learningapproach. And then I hope you go on to set the Internet on fire withsome terrific webpages.
How to use thisbook
Since you may not have learned thisway before, a brief user manual might be helpful.
- Study,practice, then rest. If you're intent on mastering thefundamentals of jQuery, as opposed to just getting a feel for it, workwith this book and the online exercises in a 15-to-30-minute session,then take a break. Study a chapter for 5 to 10 minutes. Immediately goto the online links given at the end of each chapter and code for 10 to20 minutes, practicing the lesson until you've coded everythingcorrectly. Then take a walk.
- Dont wear yourself out. Youlearn best when youre fresh. If you try to cover too much in one day,your learning will go downhill. Most people find they can comfortablycover one to three chapters a day. Your experience may vary.
- If you find some of the repetitiontiresome, skip exercises. I wrote the exercises forpeople like me, who need a lot of repetition. If youre a fast learneror a learner with some coding experience, theres no reason to burdenyourself. Click the Skip Exercise and Get Creditbutton to jump ahead. Skip whole sets of exercises if you dont needthem. Practice as much as you need to, but no more.
- If you struggle with some exercises, youknow youre really learning. Aninteresting feature of your brain is that the harder it is for you toretrieve a piece of information, the better you remember it next time.So its actually good news if you have to struggle to recall somethingfrom the book. Dont be afraid to repeat a set of exercises. Andconsider repeating exercises after letting a few weeks go by. If you dothis, youll be using spaced repetition, apower-learning technique that provides even more long-term retention.
- Do the coding exercises on a physicalkeyboard. A mobile device can be ideal for reading, butit's no way to code. Very, very few Web developers would attempt to dotheir work on a phone. The same thing goes for learningto code. Theoretically, most of the interactive exercises could be doneon a mobile device. But the idea seems so perverse that I've disabledonline practice on tablets, readers, and phones. (It also simplified myown coding work.)
- If you have an authority problem, try to getover it. When you start doing the exercises, you'llfind that I can be a pain about insisting that you get every littledetail right. For example, if you omit a semicolon, the programmonitoring your work will tell you the code isn't correct, even thoughit might run. Learning to write code with precision helps you learn topay close attention to details, a fundamental requirement for coding inany language.
- Subscribe, temporarily, to my formattingbiases. Current code formatting is likeseventeenth-century spelling. Everyone does it his own way. There areno universally accepted standards. But in the exercises, the algorithmsthat check your work need standards. They can't grant you the latitudethat a human teacher could, because, let's face it, algorithms aren'tthat bright. So I've had to settle on certain conventions. All of theconventions I teach are embraced by a large segment of the codingcommunity, so you'll be in good company. But that doesn't mean you'llbe married to my formatting biases forever. When you begin codingprojects, you'll soon develop your own opinions or join an organizationthat has a stylebook. Until then, I'll ask you to make your code looklike my code.
The language you're learning here
jQuery is a JavaScript library.That is, it's a collection of JavaScript routines that do all kinds ofthings for you without requiring you to write the underlying JavaScriptcode. It's a kind of shorthand. It's a robot that codes JavaScript.
Like JavaScript, jQuery must alwaysbe linked to by the HTML file that's creating the webpage. Youll learnhow to write this link in Chapter 27.
It's good to have some knowledge ofJavaScript when you're learning jQuery, but plenty of people don't. You