There is some content that is fetched from the server and is shown on a new page in the browser. For example of the content is
"Apple & Orange"
But when it is rendered in web page code for which is
function writeConsole(content,idx) {
top.consoleRef=window.open('','myconsole' + idx,
',menubar=0'
+',toolbar=1'
+',status=0'
+',scrollbars=1'
+',resizable=1');
top.consoleRef.document.writeln(
'<html><head><title> Generated Content </title></head>'
+'<body bgcolor=white onLoad="self.focus()">'
+ '<textarea rows="500" cols="500">'
+ content
+ '</textarea>'
+'</body></html>'
);
top.consoleRef.document.close();
}
it is getting rendered as
"Apple & Orange"
Why is this happening? I need to display the String at it is. What changes should I make to achieve this? I need to keep those escaped characters as it is. Any help or suggestions are appreciated.