Jag lyckas inte få följande att fungera i någon annan webbläsare än Firefox... Jag får inga felmeddelanden eller någontingm kan inte se vad som är fel. Webbläsaren kontrolleras ju trots allt.
Kod:
<script language="Javascript">
function xmlhttpPost(strURL) {
var xmlHttpReq = false;
var self = this;
// Mozilla/Safari
if (window.XMLHttpRequest) {
self.xmlHttpReq = new XMLHttpRequest();
}
// IE
else if (window.ActiveXObject) {
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
self.xmlHttpReq.open('POST', strURL, true);
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
self.xmlHttpReq.onreadystatechange = function() {
if (self.xmlHttpReq.readyState == 1) {
updatepage('<br /><br /><img src="loader.gif" border="0" alt="" style="margin-left:15px;" />');
}
if (self.xmlHttpReq.readyState == 4) {
updatepage(self.xmlHttpReq.responseText);
}
}
self.xmlHttpReq.send(getquerystring());
}
function getquerystring() {
var form = document.forms['feeds'];
var word = form.feed.value;
qstr = 'feed=' + escape(word);
return qstr;
}
function updatepage(str){
document.getElementById("result").innerHTML = str;
}
</script>