Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
31
rated 0 times [  35] [ 4]  / answers: 1 / hits: 41741  / 15 Years ago, tue, january 5, 2010, 12:00:00

I would like to make a button on a page that can call a JS function in the same page. The function will need to create (open) new window which its HTML code was given from the JS function itself. How can I do that?



The purpose of this is to produce a print friendly page out of a specific page.



Please notice: No AJAX can be used.


More From » html

 Answers
36
var opened = window.open();
opened.document.write(<html><head><title>MyTitle</title></head><body>test</body></html>);

[#97919] Friday, January 1, 2010, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
clifford

Total Points: 86
Total Questions: 114
Total Answers: 111

Location: Wales
Member since Mon, May 17, 2021
3 Years ago
clifford questions
Sat, Dec 18, 21, 00:00, 3 Years ago
Thu, Mar 18, 21, 00:00, 3 Years ago
Thu, May 7, 20, 00:00, 4 Years ago
;