Is the native drupal function HTTPGet from drupal.js supposed to work in internet explorer "out of the box". If so why did I find it nescessary to hack it with these lines:
var xmlhttp;
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest()
}
// code for IE
else if (window.ActiveXObject)
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
}
To get it to work?
I got loads of errors in ie before I added the ie specific part using the activex control as it is described here: http://www.w3schools.com/dom/dom_http.asp
But I realise that the auto search fields (like the author field in the node form) do work in internet explorer as well, so
it all cooks down to what am I doing wrong when I find myself hacking HTTPGet to get it to work?
My code calling HTTPGet:
var formObj = frames['img_assist_main'].document.forms[0];
var nid = formObj['edit[nid]'];
var title = formObj['edit[title]'];
var desc = formObj['edit[desc]'];
// Insert the image
var string = HTTPGet_debug('http://' + window.location.host + '/petvett.no/attach_image/attach/' + nid.value + '/' + title.value + '/' + desc.value);
var image = myDoc.getElementById('attach_image_content');
image.innerHTML = string;
Original unhacked HTTPGet:
<?php
/**
* Creates an HTTP GET request and sends the response to the callback function.
*
* Note that dynamic arguments in the URI should be escaped with encodeURIComponent().