Alex Rivera | Logout

Setting iFrame src attribute as encoded data URI with javascript in chrome

Asked 2011-12-11T19:00:34.020
19

I am trying to code an iFrame to act as a test area in an in-browser HTML/Javascript/CSS IDE in chrome, but I am losing a lot of functionality due to certain bugs, and I was wondering if someone could tell me how to set the .src attribute of the iFrame to a URL with the html Javascript CSS etc code encoded directly in the .src attribute. Don't tell me it can't be done, because I know it can, I just lost the web page where I found this method. Also, as a side note, would it be possible to programmatically force this iFrame to refresh?

Thank you for your time,

Chris

Edit
Report

1 Answer

-1

Refresh iframe:

document.getElementById('iframeid').src = document.getElementById('iframeid').src
answered 2011-12-11T20:32:57.547

Your Answer