M
M
Maxim Alyoshin2015-10-21 21:24:01
JavaScript
Maxim Alyoshin, 2015-10-21 21:24:01

How to create html inside a window created with window.open?

12ccf71bb5864953b71e10879b146596.png

In the example shown in the screenshot and link, there is a window that is called using the window.open method. I need to make the exact same thing. Question: How to place html markup in this window? How to specify a title in a popup window? Thank you in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dtestyk, 2015-10-21
@dtestyk

perhaps you will find something useful here
. Usually, the first parameter is the URL (fourth example on the link) where "html inside the window" is located, you can also change the content later (second and third examples)
you can also do this:

window.open("data:text/html, <html><head><title>some title</title></head><body><h1>text example</h1></body></html>", "_blank", "toolbar=yes, scrollbars=yes, resizable=yes, top=500, left=500, width=400, height=400");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question