Hey folks!

I figured I'd post it here first, just to see.

Ypu, I've been playing around with some AJAX stuff lately. XMLHttpRequest is quite the nifty little object.

I've managed to make a page that will load other pages within a div tag without having to reload the page. "Wooow, neato!" :lol:

Here is the royal pain in the butt now. By using the .InnerHTML property to assign the new contents for the div tag, it won't allow any of my form tags or elements to pass through it.

Any ideas?

Here is my little function that will take a call like "ajaxpage(url)" and load the assigned url to a div block called 'page'.

Code:
// XMLHttpRequest Object Function
function ajaxpage(url)
{
   var http_request = false;

   if (window.XMLHttpRequest) { // Mozilla, Safari,...
       http_request = new XMLHttpRequest();
       if (http_request.overrideMimeType) {
           http_request.overrideMimeType('text/xml');
       }
   } else if (window.ActiveXObject) { // IE
       try {
           http_request = new ActiveXObject("Msxml2.XMLHTTP");
       } catch (e) {
           try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
           } catch (e) {}
       }
   }

   if (!http_request) {
       alert('Unfortunatelly you browser doesn\'t support this feature.');
       return false;
   }
   http_request.onreadystatechange = function() {
       if (http_request.readyState == 4) {
           if (http_request.status == 200 || window.location.href.indexOf("http") == -1) {
               LoadPage(http_request, 'page');
           } else {
               alert('There was a problem with the request.(Code: ' + http_request.status + ')');
           }
       }
   }
   http_request.open('GET', url, true);
   http_request.send(null);
}

// Replace Element Contents
function LoadPage(page_request, element_id)
{
	document.getElementById(element_id).innerHTML = page_request.responseText;
}