Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    no linebreak when inserting text with JS (fixed div weight)

    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
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,703
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    Yes, of course JS generated code is not shown in the output source code because it is generated dynamically by the browser after the hard coded HTML has been created. You can see the HTML generated by JS by using the developer console that is included in most browsers, or with Firebug which is a Firefox extension.

    The best would be if you posted a link to a live example demonstrating the problem.

  • #3
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Stephan,
    thank for your fast reply.

    This is the project I'm working on:
    http://www.officerulz.com.au/

    at the nearly-bottom there is "lastest tweets" and after some seconds the overflowed text is displayed.

    Thanks

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,703
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    “Lates Tweets” isn’t showing anything for me, because:
    [NoScript] Blocking nosniff Javascript served from https://raw.github.com/remy/twitterlib/master/twitterlib.js with wrong type info text/plain, inline and included by http://www.officerulz.com.au/
    Obviously that twitter script is pulling another file from GitHub, and with the wrong MIME type. You would probably be better off downloading that script directly, hosting it yourself, and changing the file path in http://www.officerulz.com.au/twitter/src/twitter2.js on line 230, because I’ve read somewhere that IE 9 will also block scripts that are included this way.

  • #5
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the information Stephan, I've linked it as you suggested.

    Can you see it now?

    [I'm off the computer, thus I'll answer tomorrow morning.]
    Thanks in advance for the help

  • #6
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,703
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    Yes, I see it now. For the line wrapping remove line 15 in http://www.officerulz.com.au/twitter/twitter.css which is explicitly telling the HTML to not wrap on whitespaces.

  • #7
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Wow, thanks mate !!
    [It works]

    If you don't understand a coding language you think the problem MUST be the language thus I didn't looked into the css :-/

    Thanks you very very much for having a look into the code


  •  

    Posting Permissions

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