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

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

javascript - Confirm a form & display message if form is valid with JQuery -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -