I am writing an html code into javascript using document.write()
.
But the result came in the same page, I want to display the result in a separate page.
JavaScript
x
13
13
1
document.write('<table width="1000" border="1">');
2
document.write('<tr width="1000">');
3
document.write('<td width="100" bgcolor="#D8D8D8">Country</td>');
4
document.write('<td width="100" bgcolor="#D8D8D8">MCC</td>');
5
document.write('<td width="100" bgcolor="#D8D8D8">MNC</td>');
6
document.write('<td width="100" bgcolor="#D8D8D8">Network</td>');
7
document.write('<td width="100" bgcolor="#D8D8D8">Old Price</td>');
8
document.write('<td width="100" bgcolor="#D8D8D8">Current Price</td>');
9
document.write('<td width="100" bgcolor="#D8D8D8">Effective</td>');
10
document.write('<td width="100" bgcolor="#D8D8D8">Status</td>');
11
document.write('</tr>');
12
document.write('</table>');
13
So this table is being displayed in the webpage, I want this result to be displayed in another webpage.
Advertisement
Answer
Try this
JavaScript
1
14
14
1
var doc =window.open('','mydoc',
2
'width=350,height=250'
3
+',menubar=0'
4
+',toolbar=1'
5
+',status=0'
6
+',scrollbars=1'
7
+',resizable=1');
8
doc.document.writeln(
9
'<html><head><title>doc</title></head>'
10
+'<body >'
11
+'something'
12
+'</body></html>'
13
);
14