Wrox Programmer Forums
|
BOOK: Beginning JavaScript 3rd Ed. ISBN: 978-0-470-05151-1
This is the forum to discuss the Wrox book Beginning JavaScript, 3rd Edition by Paul Wilton, Jeremy McPeak; ISBN: 9780470051511
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaScript 3rd Ed. ISBN: 978-0-470-05151-1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 24th, 2010, 10:25 PM
Registered User
 
Join Date: Mar 2010
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
Default 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.
 
Old May 24th, 2010, 11:27 PM
jmcpeak's Avatar
Wrox Author
 
Join Date: Nov 2005
Posts: 87
Thanks: 0
Thanked 18 Times in 17 Posts
Default

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.

Last edited by jmcpeak; May 24th, 2010 at 11:29 PM..
 
Old May 25th, 2010, 08:35 PM
Registered User
 
Join Date: Mar 2010
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
Default 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 May 25th, 2010, 10:02 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

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
Code:
window.top.fraTopFrame.fraGlobalFunctions.resetQuiz();
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??
 
Old May 26th, 2010, 02:36 PM
Registered User
 
Join Date: Mar 2010
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
Default

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 .
 
Old May 26th, 2010, 02:47 PM
jmcpeak's Avatar
Wrox Author
 
Join Date: Nov 2005
Posts: 87
Thanks: 0
Thanked 18 Times in 17 Posts
Default

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

Last edited by jmcpeak; May 26th, 2010 at 02:51 PM..
 
Old May 27th, 2010, 02:56 PM
Registered User
 
Join Date: Mar 2010
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
Default

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++;
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 May 27th, 2010, 06:25 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Code:
while (document.QuestionForm.radQuestionChoice[answer].checked != true)
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 }.
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.









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