Use document.write to populate preview frame

This allows script execution.