p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning JavaScript 3rd Ed. ISBN: 978-0-470-05151-1 (http://p2p.wrox.com/forumdisplay.php?f=331)
-   -   One More (http://p2p.wrox.com/showthread.php?t=79536)

wildcatfan101 May 24th, 2010 10:25 PM

One More
Bad book from Wrox. I don't know why I bother anymore, was really burnt on the beginning php apache and mysql book. Was hoping this would be up to the standard of the Wrox of old. Half the code that you can download does not work. Anything more complicated that single page forms are a coin toss on if they work or not. I can't even get a response back from Wrox. I think that if you buy any beginning level book, the code should work.

jmcpeak May 24th, 2010 11:27 PM

Can you provide specific instances where the provided code does not work? We'll fix the code in the download if we know what isn't working.

wildcatfan101 May 25th, 2010 08:35 PM

Non-working code example
Downloaded code, chapter 7 quiz QuizPage.htm. Click on start quiz and it bombs out. I can give examples of other code not working and simple grammar mistakes that should not be in a 3rd edition, but it's the code that I am interested in.

Old Pedant May 25th, 2010 10:02 PM

Well, of course *THAT* page didn't work!

It's just the contents of one <frame> inside of of <frameset> that is inside another <frameset>.

The correct URL to start from is "TriviaQuiz.htm"...and then it works just fine.

Now, if the instructions in Chapter 7 didn't say that, I suppose you have a complaint. But just looking at the code you can see that the first line of code is

which indicates it's trying to call a function in another frame.

Again, if the book has not introduced framesets and frames up to this point, you have a legit complaint. But if you skipped that material, you can't blame the author(s).

Can you show another example of non-working code??

wildcatfan101 May 26th, 2010 02:36 PM

Thank you for the insight on that issue. You are quite correct and that was completely my fault, no wonder I couldn't get it to work. I looked right at the book and what file to open in my browser and still did the wrong thing.

Going back and looking through the book, perhaps I misspoke about code not working. I should have said poorly written code. Then again I am a beginner and I could be wrong on poorly written. When you are teach a beginning programmer anything you should have clear well written documented code, that is not what I am seeing. Beginners need structure. The file ch6_examp7.htm is not what I would consider code for a beginner. It does not close the option tag and the break tag is not consistent with other break tags throughout the book ie <BR> instead of <br>. You can argue that option tags doe not need to be closed in HTML and that <BR> and <br> do the same thing. To that I answer this book is for beginners and structure is what is needed.

There is another example that I can't find right now that open two paragraph tags and only closes one. No big deal, but once again no structure.

I realize that this is a java script book, but I am trying to learn, and I think that the code should be structured better.

Thank you for your prompt responses and the issue that I was having .

jmcpeak May 26th, 2010 02:47 PM

The 3rd Edition does have issues with code structure and style. Contact me: http://www.wdonline.com/contact/

wildcatfan101 May 27th, 2010 02:56 PM

One more for now and hopefully I will be finished complaining about this book,, but I reserve to revisit. Once again my favorite area the Trivia Quiz, this I really complain about because it could be worth the price of the book; if it would work that is. Page 326 is modifying the code to the function getQuestion and this piece of code is written. questionHTML = questionHTML + 'document.QuestionForm.txtAnswer.value = "";<\/script>. This piece of code does not work. I then ran the downloaded code from the book and it functioned flawlessly. This always brings groans because it's time to troubleshoot code and I start looking for my typos. Low and behold I could not find anything so I open up the downloaded code and it is different than what is in the book. I want to code, not troubleshoot the authors code. Also the function getAnswer which in on the AskQuestion page has this little snippet:
while (document.QuestionForm.radQuestionChoice[answer].checked != true)
answer = String.fromCharCode(65 + answer);

Now I do not claim to be a programmer; that is why I purchased Beginning JavaScript, but shouldn't a while loop start with a{ and end with a }. Yes it is only one line, but once again. This book is for beginners, and it is much easier to see while loops if they are all structured the same.

It is really hard to be objective due to the last Wrox book I purchased Beginning PHP 6.0 Apache and MySQL.

Old Pedant May 27th, 2010 06:25 PM


while (document.QuestionForm.radQuestionChoice[answer].checked != true)

Now I do not claim to be a programmer; that is why I purchased Beginning JavaScript, but shouldn't a while loop start with a{ and end with a }.

I'd agree with you on this one. Clearly the braces are not needed, according to the language definition, but omitting them is pretty bad practice and easily leads to later problems when you need to go modify code.

Re <BR> vs. <br> and such: It's really funny. When I first learned HTML back in the dark ages (1997 or so), all of the style guidelines *told* us to use all capitals for HTML tags! And we were even encouraged to omit </option> and </p> tags and such just to save bytes (after all, most people were till using slow modems...I know that my top speed at that time via phone line tended to be around 15K baud...that's 1.5 K bytes per second....and was often much slower).

Then along came XML and XHTML and now, depending on the DOCTYPE, you *must* use all lower case tags and all tags *must* have closures (e.g., <br/> and </p> and so on).

So I suspect that a lot of the code in that book suffered from having originated years before in maybe version 1.

I know I have code on some of my web sites that I wrote back then and I have to shudder when I look at it.

I've never seen this book, by the way. I *think* I saw version 1, many years ago. I think an office mate had it. But I can't say I ever tried to learn JavaScript from any book, so I'm surely not a good one to critique any of them.


As a complete and utter aside: Back in (I think) 1998, there was a contest called the "5K Web Page" contest. The goal was to create a web page in no more than 5K bytes (5120 bytes...taking the K the correct way). And there was good reason for it! The originators decided that too many people were producing bloated pages...as much as 20 and 30K bytes...that were just taking too long to load. So by keeping the page sizes down to 5K bytes, most people would be able to load them in under 10 seconds. You should *SEE* the code from that contest! My own code is nearly impossible for me to read today, because it's so obscure and so ugly by today's standards.

We now return you to our regularly scheduled programming.

All times are GMT -4. The time now is 02:46 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.