"TypeError: XMLHttpRequest.Open is not a function" error message
I have the following javascript code:
var XmlHttp = new XMLHttpRequest(); XmlHttp.Open("GET", "http://localhost/MenuOptions.aspx?ca_key=1631&isRollup=1", false);
In Firefox (version 22) the XmlHttp.Open() throws an error "TypeError: XmlHttp.Open is not a function"
由cor-el于
被采纳的解决方案
所有回复 (5)
is this a script error or stopage, does safe mode fix the problem
Safe mode does not fix this problem.
选择的解决方案
It seems to be "open" with a lowercase "o":
See:
I finally figured it out. The functions are case sensitive. So my XmlHttp.Open(<...>) was throwing an exception that Open is not a function. The same happened to me later on with XmlHttp.Send(null). It also said that Send is not a function but when I changed them to XmlHttp.open(<...>) and XmlHttp.send(null) then everything worked fine. So both functions need to start with a lower case letter.
Hi bbatl, as a general rule, JavaScript objects/functions and DOM objects/properties/methods are case sensitive. This may not apply to some Microsoft technologies which are more forgiving.