Forum : how to show result in another browser window?
Brief description  about Online courses   join in Online courses
View  's Profile

how to show result in another browser window?

Is it a write code to diplay result in another window??
<script type="text/javascript">
var x = 1;
var y = 2;
var z = x y
w=window.open();
w.document.open();
w.document.write("The Answer Is:" z ");
w.document.close();
</script>
Asked by | May 25, 2010 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
Hi Uma.

Your code has few errors . Here is the right code .

<html>
<head>
<title>assign-3(e)</title>
<script type="text/javascript">
function abc()
{
var x = 1;
var y = 2;
var z = x+y;
w=open("","","height=100,width=300");
w.document.open();
w.document.write("The Answer Is:"+z);
w.document.close();
}
</script>

</head>
<body>

<input type="button" name="click" value="click" onclick="javascript: abc();" />

</body>
</html>
Jul 14, 2010