www.webdeveloper.com
Results 1 to 6 of 6

Thread: Problem with linebreaks when inserting text with javascript

  1. #1
    Join Date
    Sep 2012
    Posts
    4

    Problem with linebreaks when inserting text with javascript

    Hi,

    I got a JS script (not coded by me) which loads the tweets from twitter and insert the tweet after some seconds into the page. The problem is, that if you click on "show quellcode" in your browser the text is NOT displayed in the normal html & css stuff you get from the browser.

    The text is displayed after ~ 2 seconds and even if I define the width of the div container the text is inside the text does not breaks after the defined width but just is in 1 line until infinity :-(

    If you need some code please tell me which part - (the text-displaying part?) I dont know much of JS but just use sometime some ready scripts of other developer - I only code PHP, JAVA, C++ :-/

    THanks in advance if someone replys and try to help me =/

  2. #2
    Join Date
    Mar 2009
    Posts
    452
    post the link to have a look.

  3. #3
    Join Date
    Sep 2012
    Posts
    4
    Hi.

    here is the link:
    http://www.officerulz.com.au/

    at the nearly-bottom there are the tweets (displayed after some seconds) which are overflowed.

    Regards
    HB

  4. #4
    Join Date
    Jul 2008
    Location
    urbana, il
    Posts
    2,787

  5. #5
    Join Date
    Sep 2012
    Posts
    4
    Quote Originally Posted by rnd me View Post
    display: pre-wrap
    THanks for the reply.
    The only thing I could find in google under "pre wrap" was:

    but there was no change =(
    http://officerulz.com.au (here is the script @ lastest tweets

    HTML Code:
    <pre width="xx">js text</pre>
    
    pre {  
    whitewhite-space: pre-wrap;       /* css-3 */  
    whitewhite-space: -pre-wrap;      /* Opera 4-6 */  
    whitewhite-space: -o-pre-wrap;    /* Opera 7 */  
    word-wrap: break-word;       /* Internet Explorer 5+ */  
    whitewhite-space: -moz-pre-wrap;  /* Older Versions of Mozilla */  
    }

  6. #6
    Join Date
    Sep 2012
    Posts
    4
    Hi,

    I found (with some help of someone else) the problem:
    In the css for the <ul> was "whitespace:no-wrap" thus it didn't breaks lines :-/

    THanks for the replys!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles