Search code examples
jquerycssajaxinternet-explorerpre

IE issue - Ajax loaded content in PRE tag


I face the following problem with IE8: I make simple ajax call like this

   $.ajax({
            type: "POST",
            cache: false,
            url: "UpdateMessage.php",
            data: {msgID : msgID} ,     
            success:function(RETdata)
                   {    
                       pre.html(RETdata);
                   }                                    
         });

received data is just an ordinary text from MySQL database. The text is loaded in pre tag and here raises the problem. PRE tag does not deal with newly loaded text as it should be. For Example, if there are new lines ('\r\n') in the text they all vanish.

Exactly the same text looks correctly in pre tag after reloading whole web-page. In addition I provide with css code of the pre tag

 pre{
     word-wrap: break-word;
     outline-width:0;
     MIN-HEIGHT: 50px; 
     OVERFLOW-Y: hidden;
     OVERFLOW-X:auto; 
    }

but I think, my css code is not an actual issue.


Solution

  • I believe you are better of using:

    pre.text(data);