Hi Guys new to this site but a big fan. Right the problem. It's come to our attention that sometimes on Internet Explorer the post variable don't come through. This is our basic ajax function
function GetXmlHttpObject(handler){
var objXmlHttp=null
if (navigator.userAgent.indexOf("Opera")>=0){
xmlHttp=new XMLHttpRequest();
xmlHttp.onload=handler
xmlHttp.onerror=handler
return xmlHttp;
}
if (navigator.userAgent.indexOf("MSIE")>=0){
var strName="Msxml2.XMLHTTP"
if (navigator.appVersion.indexOf("MSIE 5.5")>=0){
strName="Microsoft.XMLHTTP"
} try {
objXmlHttp=new ActiveXObject(strName)
if(handler == null) {
handler = function() {}
}
objXmlHttp.onreadystatechange=handler
return objXmlHttp
} catch(e) {
return
}
}
if (navigator.userAgent.indexOf("Mozilla")>=0){
objXmlHttp=new XMLHttpRequest()
objXmlHttp.onload=handler
objXmlHttp.onerror=handler
return objXmlHttp
}
}
and here is the call that uses it
params = "object_type="+object_type+"&object_id="+object_id;
xmlHttp_comment_notifyreset = GetXmlHttpObject(notification_reset_helper);//fails on safari 1
xmlHttp_comment_notifyreset.open("POST", url , true);
xmlHttp_comment_notifyreset.setRequestHeader("Content-Type", "application/x-www-form-URLencoded");
xmlHttp_comment_notifyreset.setRequestHeader("Content-Length", params.length);
xmlHttp_comment_notifyreset.setRequestHeader("Connection", "close");
xmlHttp_comment_notifyreset.send(params);
Right basically the object_type,object_id don't get sent despite being there. Like I say it looks to be just a IE7/8 issue that sometimes happens.
I thought that it might be a caching problem. But what we do is we have one function.js file however evertime we make a change we change the last changed timestamp and use htaccess to get the new file which seems to work. As IE etc treats the file as new in it's cache.
P.S We can't use JQuery or any other frameworks as they are too large to download for our members.
Thanks for your help. Richard