gpt4 book ai didi

javascript - Firefox 中的 Ajax 添加面板内容 JavaScript

转载 作者:行者123 更新时间:2023-11-30 00:26:39 25 4
gpt4 key购买 nike

我在 SDK 上使用 Firefox 添加。我在工具栏中有按钮,在单击事件中我显示面板 html 文件。现在我需要在单击面板 html 文件中使用的 html 按钮时使用 ajax 函数。


    <html>
<script>
function test()
{
var xhr=new XMLHttpRequest();
//some ajax Code
}
</script>
<button onclick='test()'>click Here</button>
</html>

我刚开始使用 Firefox SDK。有可能吗?如果可能的话,我应该怎么做?

最佳答案

您不能在 Firefox 插件的 html 页面内使用内联脚本,将脚本添加为打包的本地资源,它将被执行。

基本上你必须分成两部分,HTML 和 JS 并在 HTML 中引用 JS

关于javascript - Firefox 中的 Ajax 添加面板内容 JavaScript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31178969/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com