Hello, I have a code on a RJS where I want to check if an element in
the DOM has child elements, if not, show a message.
1.page["event_"+@event.id.to_s].visual_effect :fade #This works
2.page << "if $('single_blog_info_box_480').childElements().length ==
4.page << "}"
Line 1 is working. It removes an event from the view. The problem is
in line 2. I am calling childElements on a div called
'single_blog_info_box_480' (which contains the events). The idea is to
make a message appear when there are no more events left. The thing is
that I currently have 3 events and everytime the RJS is executed it
shows the same 3 events even though events have become hidden. Can
somebody guide me on how to do this or what the problem is?