Prototype.js insert issue


#1

Hi,

I am trying to use the following lines in my RJS and have a problem

page.insert_html :bottom,:list,"

    "
    #some conditions checks
    page.insert_html :bottom,:list,“
  • Hello item

  • #some more code to add
  • s
    page.insert_html :bottom,:list,"
"

The problem I am having is the first line <<page.insert_html
:bottom,:list,"

    ">> automatically closes
      if I see with firebug
      the output is
      • Hello item
      Which is wrong

      Using prototype how do I only insert a start tag

        ?

        Thanks,
        Sudhindra


    #2

    On May 20, 9:19 am, Sudhi K. removed_email_address@domain.invalid
    wrote:

    The problem I am having is the first line <<page.insert_html
    :bottom,:list,"

      ">> automatically closes
        if I see with firebug
        the output is
        • Hello item
        Which is wrong

        Using prototype how do I only insert a start tag

          ?

      looks like either prototype or the browser is fixing your html (as
      inserting just

        would be invalid). Your best bet is to build up
        all you want to insert and insert it in one go.

        Fred


      #3

      Sudhi K. wrote:

      Hi,

      I am trying to use the following lines in my RJS and have a problem

      page.insert_html :bottom,:list,"

        "
        #some conditions checks
        page.insert_html :bottom,:list,“
      • Hello item

      • #some more code to add
      • s
        page.insert_html :bottom,:list,"
      "

      Hi,
      Why don’t you try using jquery.js. Works great with rails too and is
      simpler than prototype.js.

      Reference -
      http://jimneath.org/2008/06/18/using-jquery-with-ruby-on-rails/

      Thanks,
      Manasi