javascript - How to create a CodePen pen with an iframe that references the same pen? -
i need create html code examples on codepen different html techniques. each example should 1 code pen, there's example heading outlines, forms, , 1 iframes.
the problems iframes example i'd have both content parent , embedded page in same pen. possible somehow?
<p>welcome iframe example</p> <iframe src="?frame=1" title="the iframe">
i think somehow decide whether show parent or embedded stuff when reading var frame
, what's way that? or see better way this?
i know codepen allows embedded ruby code when using slim template (which do).
pseudo code (ruby/slim style):
- if get['frame'] p iframe content - else p welcome iframe example iframe src="?frame=1" title="the iframe"
but don't have idea whether possible using embedded ruby: codepen offer global vars get
, or other way suitable need?
Comments
Post a Comment