View Single Post
Old 11-12-2012, 05:07 PM   PM User | #27
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 453 Times in 451 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
the problem I believe is that a textarea uses \n to denote a line break whereas innerHTML uses a <br>

IE seems to be the only one that is really fussy about this, but you can fix it by including a regex to replace those \n's in the function on your "start" page:

Code:
function translateIt(text) { 
var text=text.replace(/\n/g,"<br>")
parent.frames['theframe'].googleTranslateElementInit(text); 
}
xelawho is offline   Reply With Quote