English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

How do I make a pop up that I don't have to create an external html file for the pop up but instead, put the html code in the pop up code?

2007-08-30 04:19:17 · 1 answers · asked by kaynemax 2 in Computers & Internet Programming & Design

1 answers

use window.open() and in your javascript place the ENTIRE CONTENTS of an html file! (Don't forget to check for ...the size of the target screen versus the popup you're opening...the yes-or-no as to whether the window was opened before you attempt to write to it [in case the page visitor doesn't allow popups!] ...and so on...

e.g., slp=window.open(...open parameters...);
if (slp==null) alert("Can't open the separate window")
else { slp.document.open('text.html');
slp.document.write('...') <br /> ... and so on...<br /> through slp.document.close(); } </p> <p> <small> 2007-08-30 04:38:16 · <a href="#answer20070830043816">answer #1</a> · <span>answered by <u>fjpoblam</u> <b>7</b></span> · <span>1<span style='color:green;'>⤊</span></span> <span>0<span style='color:red;'>⤋</span></span> </small> </p> </div> </div> </article> </section> <div style="background:#888;padding:8px;margin-top:16px;"> fedest.com, questions and answers </div> </body> </html>