hi, learning to use JSON here, having trouble run the following snippet. What did I do wrong? FF complains “xmlhttp.open is not a function”
[code]
var readDiscussion = {
URL : function(){
var serviceURL = “”;
//preform some program and get a good url….
return serviceURL;
} , //end URL
Connect : function(){
if(XMLHttp.ajaxCall){
var xmlhttp = XMLHttp.ajaxCall;
xmlhttp.open(‘GET’, this.URL, true);
.
.
.
.
(rest of ajax code …)
.
.
.
[code]
/*
*XMLHttp obj is responible to create ajax call and send to server
* @method
* -ajaxCall returns a valid xmphttp obj based on mozilla, safari, opera, or IE. return false otherwise
*/
var XMLHttp = {
ajaxCall : function(){
var httpRequest;
try{httpRequest = new XMLHttpRequest();}//mozilla, safari
catch(e){
try{httpRequest = new ActiveXObject(“Msxml2.XML HTTP”);} //IE
catch(ee){
try{httpRequest = new ActiveXObject(“Microsoft.XMLHTTP”);}
catch(eee){
httpRequest = false;
}//end Cannot create XMLHTTP instance
}//IE4,5
}//end IE5,6
return httpRequest;
}//end ajaxCall
}//end XMLHttp