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

Re: Tabview buile from script fail if content element with new line

Expand Messages
  • 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 1 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.