S
S
slimboy2012-03-04 21:03:09
JavaScript
slimboy, 2012-03-04 21:03:09

Generating a new window with JS

Welcome all!

It is very necessary with the help of js to create a new window in the browser. Those. something like this: window.open('test.htm','new','width=300,height=200,toolbar=1')

Only using the same js and pass the body of the page. Those. in the example above, the body is loaded from the test.htm file, and I need to transfer it from the script.

Question - is it possible?

Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stdit, 2012-03-04
@slimboy

Maybe. Example from Wikipedia :

window.open('data:text/html;charset=utf-8,%3C%21DOCTYPE%20' +
  'html%3E%0D%0A%3Chtml%20lang%3D%22en%22%3E%0D%0A%3Chead%' +
  '3E%3Ctitle%3EEmbedded%20Window%3C%2Ftitle%3E%3C%2Fhead%' +
  '3E%0D%0A%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%0A' +
  '%3C%2Fhtml%3E%0A%0D%0A','_blank','height=300,width=400');

A
Anatoly, 2012-03-05
@taliban

www.javascripter.net/faq/writingt.htm _

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question