I’m new to JavaScript. Basically I want a function in JavaScript which will show me an email preview in a web browser. I’ve stored email’s template, body and contents.
SQL:
SELECT Name, template, body, contents FROM Email
WHERE EmailID = 1
C#: I have a LinkButton (ID="lnkViewDoc") on asp.net page and the code behind is:
lnkViewDoc.Attributes.Add("onclick", "return preview_email();");
JavaScript: I need a function please which will pick values from the class fields and show it in a web browser. thanks
function preview_email() {
..................
window.open() //Something
}
Contents:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org
/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<center>
..................
</center>
</body>
Body:
<div style="text-align: left"> Dear .......,
...........................................
</div>
<div style="text-align: left"> </div>