ค้นหาฝ่ายสนับสนุน

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

เรียนรู้เพิ่มเติม

"TypeError: XMLHttpRequest.Open is not a function" error message

  • 5 การตอบกลับ
  • 5 คนมีปัญหานี้
  • 3 ครั้งที่ดู
  • ตอบกลับล่าสุดโดย jscher2000 - Support Volunteer

more options

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"

I have the following javascript code: <pre><nowiki>var XmlHttp = new XMLHttpRequest(); XmlHttp.Open("GET", "http://localhost/MenuOptions.aspx?ca_key=1631&isRollup=1", false);</nowiki></pre> In Firefox (version 22) the XmlHttp.Open() throws an error "TypeError: XmlHttp.Open is not a function"

เปลี่ยนแปลงโดย cor-el เมื่อ

วิธีแก้ปัญหาที่เลือก

การตอบกลับทั้งหมด (5)

more options

is this a script error or stopage, does safe mode fix the problem

more options

Safe mode does not fix this problem.

more options

วิธีแก้ปัญหาที่เลือก

It seems to be "open" with a lowercase "o":

See:

more options

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.

more options

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.