Last active
November 21, 2018 19:48
-
-
Save Pickachu/219f1feca100f1d3c7a4263c32c0c8e3 to your computer and use it in GitHub Desktop.
Render Plunker on 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
const regex = /[?&]([^=#]+)=([^&#]*)/g, | |
url = window.location.href, | |
params = {}; | |
var match; | |
while(match = regex.exec(url)) { params[match[1]] = match[2]; } | |
var src = `https://run.plnkr.co/plunks/${params.plunkerId}`; | |
var embed = `<iframe width="100%" height="100%" src="${src}" frameborder="0"></iframe>`; | |
document.write(embed); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment