搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

why is new XmlHttpRequest() throwing an exception in Firefox 4.0.1

  • 1 回覆
  • 2 有這個問題
  • 1 次檢視
  • 最近回覆由 cor-el

more options

the following javascript has been working in prior version of Firefox (3.x) but is throwing an exception in Firefox 4.0.1 oddly enough the request object is being created in the try block but then is nulled in the catch block

   var xmlHttp;
   // branch for native XMLHttpRequest object
   if(window.XMLHttpRequest) {
   	try {

xmlHttp = new XMLHttpRequest();

       } catch(e) {

xmlHttp = null;

       }
   // branch for IE/Windows ActiveX version
   } else if(window.ActiveXObject) {
     ....
the following javascript has been working in prior version of Firefox (3.x) but is throwing an exception in Firefox 4.0.1 oddly enough the request object is being created in the try block but then is nulled in the catch block var xmlHttp; // branch for native XMLHttpRequest object if(window.XMLHttpRequest) { try { xmlHttp = new XMLHttpRequest(); } catch(e) { xmlHttp = null; } // branch for IE/Windows ActiveX version } else if(window.ActiveXObject) { ....

所有回覆 (1)

more options

A good place to ask questions and advice about web development is at the mozillaZine Web Development/Standards Evangelism forum.
The helpers at that forum are more knowledgeable about web development issues.
You need to register at the mozillaZine forum site in order to post at that forum.

See http://forums.mozillazine.org/viewforum.php?f=25