fabiotinoco (2) [Avatar] Offline
#1
Hi Monsur,

I am going through the book and the example in chapter 2 isn't working for me. I've created the files app.js and client.html, copied and pasted the code but the blog posts aren't being displayed. I activated Google Chrome dev tools and the error I got was "Uncaught Reference Error: i is not defined" at line 22: "var postText = data[i][1];"
I tried a few things to get it to work, but couldn't as I'm not an experienced developer.

Thanks,

Fabio
monsur.hossain (22) [Avatar] Offline
#2
Re: Example chapter 2, listings 2.1 and 2.2 not displaying text
Thanks for the report Fabio! This is indeed a bug. Looking at listing 2.2, the line that reads "var postText = data[i][1];" should be removed. If you delete that line, the code should work. I'll will update the corresponding code in chapter 2.

Thanks,
Monsur
fabiotinoco (2) [Avatar] Offline
#3
Re: Example chapter 2, listings 2.1 and 2.2 not displaying text
It works now Monsur, many thanks...