2009-09-14 74 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