p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Book: Beginning iOS Application Development with HTML and JavaScript (http://p2p.wrox.com/forumdisplay.php?f=671)
-   -   Chapter 3 errors (http://p2p.wrox.com/showthread.php?t=88861)

bradut November 23rd, 2012 07:06 PM

Chapter 3 errors
 
There are errors in the code I downloaded, and the some of the errors are also in the book.

In BIDHJ-Ch03-Ex1.html
Code:

document.getElementById("movieList.).insertBefore(f, casa);
should be:
Code:

document.getElementById("movieList").insertBefore(fb, casa);
and
Code:

document.getElementById("movieList.).insertBefore(f, br.nextSibling);
should be:
Code:

document.getElementById("movieList").insertBefore(fb, br.nextSibling);
besides these errors, I think that the script should be placed at the end of the 'body' element, otherwise getElementById() will not find the elements.

In the other example, BIDHJ-Ch03-Ex2.html, there are some other issues:
I could not get any desktop browsers [maybe Safari in iPhone is different] work with the method createAttribute("name", "value"). All references I found on Internet indicated two steps:
1. a = createAttribute("name")
2. a.nodeValue("value")
[or use e.setAttribute("name", "value")]

So, besides moving the script at the bottom of the 'body', I had to do the following changes:
1.
Code:

a = document.createAttribute("id"); a.nodeValue  = "film_29299";
instead of
Code:

document.createAttribute("id", "film_29299");
2.
Code:

e.setAttributeNode(a);
instead of
Code:

e.appendChild(a);
[need to do this three times]

Final notes:
I found the level of support for this book pretty poor, since the author didn't answer/address any of the issues posted in the forum.

I also found Wrox errata system very difficult to handle, as, despite it initially asked me only for my email and my comments; as soon as I input my email it suddenly displayed tons of input fields I really don't want to waste my time to answer ...enough that I'm helping them for free:)


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

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