Last active
April 3, 2016 20:43
-
-
Save cpoDesign/7e5079f3b1e3b8d911474a2a5131a9b2 to your computer and use it in GitHub Desktop.
example of generating iframe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<button onclick="pgen(1)" >open 1 </button> | |
<div id="gen"> | |
demo | |
</div> | |
<script src="https://code.jquery.com/jquery-1.12.2.min.js" integrity="sha256-lZFHibXzMHo3GGeehn1hudTAP3Sc0uKXBXAzHX1sjtk=" crossorigin="anonymous"></script> | |
<script> | |
function pgen(videoId) { | |
var link = "http://www.cpodesign.com" | |
var iframe = document.createElement('iframe'); | |
iframe.frameBorder=0; | |
iframe.width="300px"; | |
iframe.height="250px"; | |
iframe.id="randomid"; | |
iframe.setAttribute("src", link); | |
$('#gen').html(iframe); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment