AJAX works fine in firefox, but malfunctions in Mozilla Prism 0.9
Posted
by Babiker
on Stack Overflow
See other posts from Stack Overflow
or by Babiker
Published on 2010-05-27T22:03:12Z
Indexed on
2010/05/27
22:11 UTC
Read the original article
Hit count: 286
I have the following ajax fucntion:
function ajax(value, url, urlVarname, displayContainers_id){
if(value == ''){
document.getElementById(displayContainers_id).innerHTML='';
}
/* THIS IS LINE 12*/ xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
document.getElementById(displayContainers_id).innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open('GET',url + '?varName=' + urlVarname + '&value=' + value, true);
/* THIS IS LINE 25 */ xmlhttp.send();
}
onmousedown="ajax(document.getElementById('searchParamater').value, 'http://192.168.0.7/controllers/search_controller.php', document.getElementById('searchBy').value, 'ajaxBucket')">
This whole thing works fine in firefox but when i use prism 0.9, it malfunctions and i get the following error in the errors console:
Warning: assignment to undeclared variable xmlhttp
Source File: http://192.168.0.7/javascript/main.js
Line: 12
Error: uncaught exception: [Exception... "Not enough arguments [nsIXMLHttpRequest.send]" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://192.168.0.7/javascript/main.js :: ajax :: line 25" data: no]
© Stack Overflow or respective owner