Iframe Source With Variable April 19, 2024 Post a Comment I have a couple of questions: Is the same as HTMLIFrameElement ? Why Solution 1: YesYou need to append the iFrame to the document. Like sodocument.body.appendChild(b)Solution 2: The Data URI scheme is for direct embedded data.data:text/html;base64,aHR0cDovL2V4YW1wbGUuY29t CopyMeans a html page with "http://example.com" as its sole content.You probably want "http://example.com" as srcSolution 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"