March 14th, 2012, 01:14 PM
Hello! This is my first post so I'd like to start by thanking the team here at Dev Shed for their work, and I'd also like to thank the open source community as well for all the help I'll undoubtedly receive along the way.
The good news is that the code works fine.
output = "PROBLEM";
My question is... Do switches automatically generate client-side alerts? Or was there an error in the writing of the book?
From what I've gathered in the book, the author would lead me to believe that my last piece of code wasn't necessary, and the alert would automatically be generated, but after trying it in 4 browsers i can say with certainty that the code wouldn't generate an alert until after i amended it.
My reason for asking is that I want to ensure i have a thorough knowledge of exactly what why and how i'm learning web development.
March 14th, 2012, 04:44 PM
You are correct: the browser won't show any alert()s unless you specifically tell it to show one.
Printed books often have mistakes. Take what they say with a grain of salt and independently verify what they tell you. Also check their website(s) for errata sections: there may be mistakes but they'll often address them after publishing.
March 14th, 2012, 05:18 PM
I figured as much...
Thank you requinix for the information!
March 16th, 2012, 08:47 AM
It's also possible they weren't going to output anything until later in the chapter. People get confused when you say:
"Now you're going to output it to make sure it works. I know it WILL work, since I wrote it and tested it before I gave it to you, but I'm trying to teach you good debugging. No, there's no bugs. Just alert it. See? Now delete it. The alert. No not the whole thing. Because we needed the alert for debugging. No, of course there's no bugs in THIS, but in the future...No, bugs won't magically appear in this code in the future, I meant in YOUR future. You know what, just move on."
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question
or you're a Help Vampire.
Trying to argue intelligently? Please read this.
March 16th, 2012, 07:05 PM
Wait? So there's a bug in my code?
Lol jk jk