Hi,
has anybody been able to put example of chapter 5 in practice?
The chapter starts with entering some sample entries to the page.
As a temporary measure, we’ll attach event handlers to the ondblclick events of these two entries in the init method of our Blog class:
so enter
var entry1 = document.getElementById(‘main1’);
var entry2 = document.getElementById(‘main2’);
entry1.ondblclick = self.toggleEditInPlace;
entry2.ondblclick = self.toggleEditInPlace;
and then it goes on saying:
We’ll replace this code later, but it will serve our current development purposes just fine.
And that’s all working fine, but as I read the chapter I did not find any replacement.
Lets say I like to use it on real web site where I would have 15+ comments. How can I attach the double click event to all of them? In the book
we hard wire 2 comments but that about it.
Obviously the code should be finding all available comments and making them editable on the double click event.
Did I miss something? Please if you have some experience, let me know.
Thanks