You can't really do that because the code has to be stored somewhere (I.E. A file).
You can write html on-the-fly but as above it needs somewhere to go. You could try creating a delibrately "blank" html page. That your frameset loads into the required frame by default and then writing the code to it as you need it.
Hope that helps....