Hello again - I just spent the past hour and a half writing a little iFrame polling script because iFrames are REALLY ugly and they usually end up with scrollbars that you don't want.

I needed nicely formatted output with no scrollbars.

Change the iframe code to this:

<iframe id="iframe_source" src="commands.php" style="display: none;" />
<div id="visual_destination"></div>
// At an interval of 250 milliseconds, update the content of "visual_destination" with the data that is currently loaded in the "iframe_source" element.
new iFramePoller("iframe_source", "visual_destination", 250);

iframe-poller.js // requires Prototype JS (http://prototypejs.org/)
 * Copyright 2009 Michael White
 * You may contact me at: michael--at--getsprink--dot--com
 * Website: http://getsprink.com
 * LICENSE: This code is free for use and modification provided this copyright notice and license remains in tact.
 * This software comes without ANY warranty, expressed or implied. (i.e. - this code may or may not work for you!)
 * If you do use this code or a modified version of it on a project/website I would like to know! Contact me at the e-mail address listed above.
 * I do offer paid consultation and assistance services for your JavaScript and PHP needs.
 * If you would like help implementing or modifying this software for your solution, contact me at michael--at--getsprink--dot--com

// This script is used to poll an iframe on a set interval and update an HTML container element.

// Data is checked each time a content check is made to make sure that the data has actually changed prior to updating the destination element.

// Also, the onload event is listened for on the iFrame and that event triggers the stopPolling() function and no more updates are made after that point.

// It makes sense to set the iframe's display property to "display: none;" so that only the other HTML container element is visible.

// You can configure the interval frequency

var iFramePoller_InstanceStack = {};

var iFramePoller = Class.create({
	global_config: {
		trace: false,
		log: false
	source_id: null,
	dest_id: null,
	source_el: null,
	dest_el: null,
	interval: 250,
	data_cache: null,
	poll_timer: null,
	reference_id: null,
	initialize: function(iframe_source_id, destination_element_id, interval) {
		this.source_id = iframe_source_id;
		this.source_el = $(this.source_id);
		this.dest_id = destination_element_id;
		this.dest_el = $(this.dest_id);
		this.interval = interval ? interval : this.interval;
		// Generate a random reference ID to persist the scope when using setTimeout
		this.reference_id = "iFramePoller-instance-id-"+Math.random(30, 1500);
		iFramePoller_InstanceStack[this.reference_id] = this;
	__trace: function(function_name) {
        if(this.global_config.trace === true) {
            console.log("iFramePoller." + function_name + "()");
    __log: function(message) {
        if(this.global_config.log === true) {
    setTimer: function() {
    	// Setup a timer for checking the iFrame content and updating the destination element.
		this.poll_timer = setTimeout(this.doPoll.bind(this), this.interval);
	startPolling: function() {
		var ref = this.reference_id;
		// Setup a listener callback for the onload event of the source iFrame
		Element.observe(this.source_el, "load", this.stopPolling.bind(this));
	stopPolling: function() {
		// Delete the iframe 0.5 seconds after the last content update.
		setTimeout(this.destroySourceIframe.bind(this), 500);
	destroySourceIframe: function() {
	doPoll: function() {
	updateContent: function() {
		var doc = null;
		if(this.source_el.contentDocument) {
            this.__log("Using contentDocument");
            doc = this.source_el.contentDocument;
        /* Bugfixed to work in IE6 */
        else if(iframe.contentWindow.document) {
            this.__log("Using contentWindow.document");
            doc = this.source_el.contentWindow.document;
        else {
            this.__log("Using frame[frame_id].document");
            doc = window.frame[this.source_id].document;

        this.dest_el.innerHTML = doc.body.innerHTML;