Errata

Ajax with PHP 5

Errata for Ajax with PHP 5

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 17
Main PHP script

The $result of the Bookloader script is not available to the onData function in searchXML1.js.
httpObj.responseXML returns null

Anonymous  Jan 08, 2013 
Printed Page 5.3
function onData

(http://safari5.bvdep.com/9780596514037/parsing_json_data_in_javascript)

The line var books = eval(httpObj.responseText);
does not compile for me. I have looked up the resulting Syntax Error on google and found out that it
does work if you add some extra parenthesis like this

var books = eval( "(" + httpObj.responseText + ")" );

I understand that this is a json problem probably having to do with the version of the php json library.

Here's a page on the problem:
http://www.bennadel.com/blog/99-JSON-Minor-But-VERY-Important-Detail-Creating-Syntax-Error-Invalid-
Label.htm

So it's not technically an erratum but I'd like to report it anyway, since it was an embuggerance for me
and likely will be so for other users. Apart from that - great book.

One more thing. There are no page numbers in the online book so I gave the chapter instead. You might
want to have the form fixed.

Anonymous