Opera/IE Troubles - next line and backslashes symbols

Discussion in 'JavaScript' started by 3dom, Apr 9, 2008.

  1. #1
    Hello!

    IE6 problem is then JS construct string like '\r\n\r\nSome text here' at start and then passes it onto TEXTAREA

    var addstring = '\r\n\r\nSome text here';
    document.getElementById('targetDIV').innerHTML = addstring;

    I can see only space symbol(s) at the beginning of the string in textarea (not a new line). In FF/Opera works like a charm however. How to make it work in IE?

    Opera problem is then script make operation like

    var somevar = document.getElementById('targetDIV').innerHTML;
    somevar = '<a href="link.htm">new link text</a>' + somevar;

    it adds additional backslashes to the "old content" so it looks completely smashed - like <a href=\"link.htm\">link. text</a> (i've tryed somevar.replace('\\','') - didn't help). Any ideas?

    (btw I'm talking about http://picmass.com )

    Thanks in advance =)
     
    3dom, Apr 9, 2008 IP
  2. Dade72

    Dade72 Peon

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I'm pretty sure \r are not needed in IE6, and with the Opera problem... have you tried:
    somevar = '<a href=\"link.htm\">new link text</a>' + somevar
     
    Dade72, Apr 10, 2008 IP