Loading ...
Sorry, an error occurred while loading the content.

Tabview buile from script fail if content element with new line

Expand Messages
  • spolichou
    Dears: Can any one help me ? The original code: tabView.addTab( new YAHOO.widget.Tab({ label: lorem , content: Lorem ipsum dolor sit amet, consectetuer
    Message 1 of 3 , Sep 29, 2008
    • 0 Attachment
      Dears:
          Can any one help me ?
      The original code:
            tabView.addTab( new YAHOO.widget.Tab({
              label: 'lorem',
              content: '<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat.</p>',
              active: true
          }));

      If I separate the content with following
          tabView.addTab( new YAHOO.widget.Tab({
              label: 'lorem',
              content: '<p>Lorem ipsum dolor sit amet,
                        consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat.</p>',
              active: true
          }));

      The tabview will not function as usual.
      how to fixed it.

      Thanks.

    • Caridy Patino
      Hi, I don t see any difference in this code... what is the problem? Best Regards, Caridy Patino (caridy at yahoo-inc.com) Yahoo! LATAM ... adipiscing
      Message 2 of 3 , Sep 30, 2008
      • 0 Attachment
        Hi,

        I don't see any difference in this code... what is the problem?

        Best Regards,
        Caridy Patino (caridy at yahoo-inc.com)
        Yahoo! LATAM

        --- In ydn-javascript@yahoogroups.com, "spolichou" <spolichou@...> wrote:
        >
        > Dears:
        > Can any one help me ?
        > The original code:
        > tabView.addTab( new YAHOO.widget.Tab({
        > label: 'lorem',
        > content: '<p>Lorem ipsum dolor sit amet, consectetuer
        adipiscing
        > elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna
        > aliquam erat.</p>',
        > active: true
        > }));
        >
        > If I separate the content with following
        > tabView.addTab( new YAHOO.widget.Tab({
        > label: 'lorem',
        > content: '<p>Lorem ipsum dolor sit amet,
        > consectetuer adipiscing elit, sed diam nonummy nibh
        > euismod tincidunt ut laoreet dolore magna aliquam erat.</p>',
        > active: true
        > }));
        >
        > The tabview will not function as usual.
        > how to fixed it.
        >
        > Thanks.
        >
      • ronnyh1969
        The content you are adding are nothing but a string. In javascript a string cannot be written on multiple lines, split by newlines. You need to quote each line
        Message 3 of 3 , Sep 30, 2008
        • 0 Attachment
          The content you are adding are nothing but a string. In javascript a
          string cannot be written on multiple lines, split by newlines. You
          need to quote each line and concatenate them:

          tabView.addTab( new YAHOO.widget.Tab({
          label: 'lorem',
          content: '<p>Lorem ipsum dolor sit amet, consectetuer adipiscing' +
          ' elit, sed diam nonummy nibh euismod tincidunt ut' +
          ' laoreet dolore magna aliquam erat.</p>',
          active: true
          }));

          ~Spiralis

          --- In ydn-javascript@yahoogroups.com, "spolichou" <spolichou@...> wrote:
          >
          > Dears:
          > Can any one help me ?
          > The original code:
          > tabView.addTab( new YAHOO.widget.Tab({
          > label: 'lorem',
          > content: '<p>Lorem ipsum dolor sit amet, consectetuer
          adipiscing
          > elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna
          > aliquam erat.</p>',
          > active: true
          > }));
          >
          > If I separate the content with following
          > tabView.addTab( new YAHOO.widget.Tab({
          > label: 'lorem',
          > content: '<p>Lorem ipsum dolor sit amet,
          > consectetuer adipiscing elit, sed diam nonummy nibh
          > euismod tincidunt ut laoreet dolore magna aliquam erat.</p>',
          > active: true
          > }));
          >
          > The tabview will not function as usual.
          > how to fixed it.
          >
          > Thanks.
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.