” and ‘ ’ are very important) Most important, $('#cart').html(_cart.html.erb we returned), it is a jQuery syntax which put the HTML we return into the element with id cart, You can write it in traditional javascript syntax, document.getElementById(“cart”).innerHTML = <%= xxx %>; 12年10月20日星期六