I am trying to use the following lines in my RJS and have a problem
page.insert_html :bottom,:list,"<ul>"
#some conditions checks
page.insert_html :bottom,:list,"<li>Hello item</li>"
#some more code to add <li>s
page.insert_html :bottom,:list,"</ul>"
The problem I am having is the first line <<page.insert_html
:bottom,:list,"<ul>">> automatically closes <ul> if I see with firebug
the output is
<ul></ul>
<li>Hello item</li>
</ul>
Which is wrong
Using prototype how do I only insert a start tag <ul>?
looks like either prototype or the browser is fixing your html (as
inserting just <ul> would be invalid). Your best bet is to build up
all you want to insert and insert it in one go.