Sometimes it is necessary to change source of the iframe on facebook applications dynamically. In Facebook applications iframe can be created only using tag "fb:iframe" and Facebook doesn't allow access to iframe attributes. Of course we can create a set of fb:js string variables for all cases that we need. But it is not very good solution.
One of the solutions that can be used looks as follows.
At first create iframe using fbml:
<fb:js-string var="iframe_element">
<fb:iframe id="fb-iframe" src="http://your.iframe.location" />
</fb:js-string>
Than we should have an html element that will be a container for iframe:
<div id="iframe-block"> </div>
Next step is to display iframe. This can be done using fbml method setInnerFBML:
document.getElementById('iframe-block').setInnerFBML(iframe_element);
After this we can get access to iframe attributes.
document.getElementById('view-iframe-element').setSrc('http://your-new-url');
So, the only way to change the src of iframe that I could find is to display the iframe and the change it attribute src.