2009-09-14 48 views
0

如果不明白Firefox的添加對外部請求的方法,我感到困惑。如何向Firefox添加請求

感謝您提前。

+0

不知道你在問什麼,但它聽起來像XmlHttpRequest。這裏有一個例子:http://forums.mozillazine.org/viewtopic.php?f=19&t=102637&start=0&st=0&sk=t&sd=a – KiNgMaR 2009-09-14 06:16:29

+0

問題不是很清楚。 – mauris 2009-09-14 06:17:02

回答

5

這個問題並不十分清楚,但如果您在Firefox Addon中尋找類似HTTPRequest的內容,以下代碼段可能會對您有所幫助。

var xmlhttp = new XMLHttpRequest(); 


xmlhttp.open("GET", "http://www.sitetorequest.com",true); 
xmlhttp.onreadystatechange=function() { 
    if (xmlhttp.readyState==4) { 
    alert(xmlhttp.responseText); 
    Your Code here... 
    } 
} 

xmlhttp.send(null) 
+0

Im main.js這給了我一個'XMLHttpRequest未定義'消息 – 2015-06-04 20:20:16