Errata

Building iPhone Apps with HTML, CSS, and JavaScript

Errata for Building iPhone Apps with HTML, CSS, and JavaScript

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date Submitted
PDF Page 33
bottom

reference to DOM events should be http://www.w3schools.com/jsref/dom_obj_event.asp

Anonymous  Jun 01, 2013 
PDF Page 70
Lower heading

Saving user settings (in the settings panel) to local storage via the submit button will not work on my iPhone 4 (iOS 6) unless the following is applied to kilo.js:

formSelector: false,
useFastTouch: false

The <form> element must also be of class="form".

Issues with jQTouch submit on the iPhone seem relatively common, and some combination of these three changes seem help. See the following for a discussion: http://code.google.com/p/jqtouch/issues/detail?id=125

Cole  Feb 02, 2013 
Printed Page 71
4 paragraph following thr goBack

On page 71 you talk about goBack(); then mention return false to cancel the form submit action..

This does work fine if you hit the form submit button but if you hit the GO button on the iphone keypad instead which some people will maybe do more so, it just all goes black and blank and you need to come out the app and go launch it again to continue..

quite annoying as its quite a key thing and something that needs fixing.

apart from that loving the book so far!!..

cheers
Mark

Mark Keast  Dec 08, 2011 
Printed Page 29

http://ofps.oreilly.com/titles/9781449383268/ch03.html#ch03_id35816921
the link you provided in the errata above does not respond...page not found reported.

Joseph DaSilva  Aug 03, 2011 
Other Digital Version 41
Chapter 3 samples

The sample in chapter 3 is wrong as some other people pointed out already. It seems the code you are checking is not the same as the one we are downloading from the O'Reilly website. Here are some of the problems I found in file iPhone.js.

- The element variable is set to ' #header ul'. It should be just ' #header' since it seems the intention is to place the 5 top links in the 'container' section of the page.
- The line $('h1').html(title); does nothing because there is no <h1> tag in the page.
- The line $('#header').append('<div class="leftButton">'+hist[1].title+'</div>'); does nothing because by the time it executes, $('#header') does not exist.

- A simple solution was to add a div with id='header' and an empty <h1> tag for the rest of the code to execute as intended.

I removed part of the code related to : if (url.match(/jonathanstark.com/)) in a way it executed properly in my machine environment.

Below is the code which runs OK for me.

Thanks. The book is nice, clear and to the point. So far I find it very helpful.



var hist = [];
var startUrl = 'index.html';
$(document).ready(function(){
loadPage(startUrl);
});
function loadPage(url) {
$('body').append('<div id="progress">Loading...</div>');
scrollTo(0,0);
if (url == startUrl) {
var element = ' #header';
} else {
var element = ' #content';
}
$('#container').load(url + element, function(){
var title = $('h2').html() || 'Hello!';
if (title != 'Hello!')
$('#container').prepend('<div id=\'header\'><h1></h1></div>');

$('h1').html(title);
$('h2').remove();
$('.leftButton').remove();
hist.unshift({'url':url, 'title':title});
if (hist.length > 1) {
$('#header').append('<div class="leftButton">'+hist[1].title+'</div>');
$('#header .leftButton').click(function(e){
$(e.target).addClass('clicked');
var thisPage = hist.shift();
var previousPage = hist.shift();
loadPage(previousPage.url);
});
}

$('#container a').click(function(e){
var url = e.target.href;
e.preventDefault();
loadPage(url);
});
$('#progress').remove();
});
}

Gonzalo Isaza  May 24, 2011 
PDF Page 102

(please ignore my previous errata submission; the following is my corrected version)


While the PHP file given on page 102 works just fine, the actual PHP file you download from the O'Reilly website (ch06/Kilo/manifest.php) is missing the closing ?> PHP script tag.

As a side note, I'd like to applaud you on writing a great book Jonathan. I have thoroughly enjoyed walking through each example. As a web developer it beats the heck out of learning xcode etc :)

Mark Read  Mar 06, 2011 
Printed Page 99

While the PHP file given on page 99 works just fine, the actual PHP file you download from the O'Reilly website (ch06/Kilo/manifest.php - which includes the hash calcs) is missing the closing ?> PHP script tag.

Mark Read  Mar 06, 2011 
PDF Page 32
Example 3-3

I agree, I spent long time to figure it out
Header DIV should go out of the Container DIV in theindex.html for for this example to work on Safari Mobile.

Anonymous  Jan 13, 2011 
Printed Page 122
1223rd paragraph

I've downloaded and installed PhoneGap, but the Folder looks not like the description in the Book. Where must I put my files? Page 122. German edition.
Thanks

Anonymous  Jan 07, 2011 
PDF Page 64
middle

After completing the code for Kilo, on page 64, my app does not display css and jQTouch layout correctly. I re-read the code and checked it agains mine, and they are identical. Yet, my app doesn't look anything like the screenshots in the book. For starters, my background is all black. I don't understand...

Igor Ganapolsky  Aug 31, 2010 
PDF Page 32
in examples on website

The index.html doesn't work on Safari 5.0.1/iOS4 until you move the header DIV outside the container DIV.

Anonymous  Aug 01, 2010