I’ve been following the course of the chapter (2nd ed.) pretty smoothly until I am stuck with Iteration D2: Adding Ajax cart to depot (pg. 130-132). I have already get the code copied verbatim from the book (and from the given link) and but the error persists. The error says: When The “Add to Cart” button is pressed (which supposed to run the js code), the browser respond with message like: RJS error: TypeError: element is null. Element.update(“cart”, ….the cart template content….”); Strangely so, that after the error dialog was dismissed, I get the browser refreshed manually and the expected results (new item added to the cart) appear on the sidebar. I’ve tried to reload the index page, tried different browsers, same problem occurs.
Any help, hint, or pointers on the problem would be very much appreciated.