Hey guys,
I am having a weird error in Mozilla.
when i try and execute menubar_ function, it gives me an error that “menubar is not a constructor” in mozilla firefox only. It runs fine with IE.
Does anyone have any idea?
thanks,
Parth
=========================================================
function menubar(xmldoc){
alert(xmldoc);
// Parse XML ….
// x element has responseXML data
no = 4;
….
…
…
..
//
this.redo = function (){
….
…
..
}
}
var x;
function execute_menu(xml){
x = new menubar(xml);
}
function menubar_(xmldoc){
var xmlHttp;
if (!window.ActiveXObject)
xmlHttp= new XMLHttpRequest();
else
xmlHttp = new ActiveXObject(“Microsoft.XMLHTTP”);
xmlHttp.open(“GET”,xmldoc,true);
xmlHttp.setRequestHeader(“Content-type”, “application/x-www-form-urlencoded”);
xmlHttp.setRequestHeader(“Connection”, “close”);
//
// set the function on state change, which is the action to be performed when state changes
xmlHttp.onreadystatechange=function (){
if(xmlHttp.readyState==4)
execute_menu(xmlHttp.responseXml);
}
// now make a request
xmlHttp.send(null);
//
return x;
}