jquery - How to add with Iframe -


i have jquery line allows me open.window , access 1 of html file works great. please see sample code.

<?php if (isset($_session['currentfile'])) { ?> $("#sourcepreviewout").click(function () { window.open("<?php $dir = "template/" . trim(file_get_contents("admin/template.txt")) . "/result/"; echo $dir . $_session['currentfile']; ?>", '_blank'); }); <?php } ?> }); 

i want add <iframe> on window.open, ... how can write code add <iframe> size of 200px 200px on window open , show html file inside of <iframe>!

you don't need jquery. can easy javascript.

// change "src" of iframe html link var iframe = "<iframe src='https://wiki.selfhtml.org/wiki/javascript/window/open' width='200' height='200'></iframe>";  var openwindow = window.open("", "opened window", "width=500,height=500,location=no");  openwindow.document.write(iframe); 

example: https://jsfiddle.net/06hpd7p7/1/

i think, all, need


Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -