Help with the Javascript Coding

Discussion in 'JavaScript' started by Soner, Jul 13, 2009.

  1. #1
    Hi people,

    I got a Javascript but I have to edit it. I searched everywhere but couldnt how to make line break in js. I tried "\n" but it didnt work for me.

    All I want to do is something like this :

    "Hi

    Hello

    Bye"

    Would appreciate. Thanks,

    Soner
     
    Soner, Jul 13, 2009 IP
  2. aquilax

    aquilax Member

    Messages:
    126
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    33
    #2
    Use <br /> if you plan to show the result in a browser. otherwise "\n" should work. Or you can use <pre></pre> with \n
     
    aquilax, Jul 13, 2009 IP
  3. Soner

    Soner Active Member

    Messages:
    479
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #3
    When I use "br" tag it shows in the browser <br/> and I used "\n" like this, still doesnt work :(

    next venture.\n"Accurate Insurance Services \n" ';
     
    Soner, Jul 13, 2009 IP
  4. aquilax

    aquilax Member

    Messages:
    126
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    33
    #4
    This works for me:

     
    aquilax, Jul 14, 2009 IP
  5. Sheikh Ahsan

    Sheikh Ahsan Peon

    Messages:
    101
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I m just confused how and in what way java differs from other programming lanuages!!
     
    Sheikh Ahsan, Jul 15, 2009 IP
  6. Soner

    Soner Active Member

    Messages:
    479
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #6
    It not possible for me to write that in the code.

    Has anyone got an idea why \n doesnt work?
     
    Soner, Jul 16, 2009 IP
  7. mioot

    mioot Peon

    Messages:
    169
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    The \n is new line character it does not identify by the browser. The browser only identify the markup languages like start and end with &lt; and &gt;.
     
    mioot, Jul 18, 2009 IP