Hi Marc,
I've had a look through that chapter and I believe that it wasn't the authors intention to cover the loading of existing story content.
The use of "As a temporary measure" does suggest the author will deal with it later on in the chapter but it's not until the end, under 'Future Enhancements" that it is mentioned again. So, I can see how it's misleading.
If you run the demo from the code archive, which has no existing entries, you'll see that new entries become editable after they are saved. I believe the author's intention was to show a simple demo that implements creating, editing and saving via Ajax - which it does, if only in a limited fashion.
Incidentally if you do run the code from the archive on a web server, the Ajax form is submitted to a root-relative URI, which means you have to place the demo in the root folder of your web server. If you do not wish to do that you can change it so the whole demo runs within the same folder as the blog.html file.
Just change:
Code:
self.ajax.doPost('/blog_process.php', postData, self.handleSave);
to:
Code:
self.ajax.doPost('blog_process.php', postData, self.handleSave);
in the blog.js file.
So, best of luck and make sure to let us know how you get on!
Cheers
Bookmarks