XMLHtt prequest的Firefox扩展 [英] XMLHttpRequest in Firefox Extension

查看:109
本文介绍了XMLHtt prequest的Firefox扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写一个Firefox拓并希望从服务器加载数据。但是,当我尝试初始化XMLHtt prequest有:

I am writing a FireFox-Extension and want to load Data from Server. But when I try to initialize the XMLHttpRequest with:

var request = new XMLHttpRequest();

错误控制台说:

The error console says:

ReferenceError: XMLHttpRequest is not defined

我一定要包括什么或为什么XMLTtt prequest无法识别?

Do I have to include something or why the XMLTttpRequest is not recognized?

推荐答案

该加载SDK(你是通过加载项Builder中使用间接)提供的 要求,本质围绕 XMLHtt prequest 的包装,你应该使用它。据我了解,你是不是给定的直接 XMLHtt prequest 获得prevent问题,如果附加卸载/禁用而请求被执行。

The Add-on SDK (that you are using indirectly via the Add-on Builder) provides a request package that is essentially a wrapper around XMLHttpRequest, you should use it. From what I understand, you aren't given direct XMLHttpRequest access to prevent issues if the add-on is uninstalled/disabled while a request is being performed.

这篇关于XMLHtt prequest的Firefox扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆