Iframe Source With Variable September 30, 2022 Post a Comment I have a couple of questions: Is the same as HTMLIFrameElement ? Why Solution 1: Yes You need to append the iFrame to the document. Like so document.body.appendChild(b) Solution 2: The Data URI scheme is for direct embedded data. data:text/html;base64,aHR0cDovL2V4YW1wbGUuY29t Copy Means a html page with "http://example.com" as its sole content. You probably want "http://example.com" as src Solution 3: To your point 2: your two methods give the same result. Live demo: http://jsfiddle.net/Ft9gh/ a=document.getElementsByTagName('body')[0]; b=document.createElement('iframe'); b.src="data:text/html;base64,aHR0cDovL2V4YW1wbGUuY29t"; a.appendChild(b); Copy Share Post a Comment for "Iframe Source With Variable"
Post a Comment for "Iframe Source With Variable"