gpt4 book ai didi

php - Joomla + Mootools XMLHttpRequest 问题

转载 作者:行者123 更新时间:2023-11-28 10:33:36 26 4
gpt4 key购买 nike

我正在构建一个 Joomla 扩展,并尝试使用 MooTools 将一些数据发送到 php 脚本,以保存在数据库中。

这是请求的代码:

    myReq: new Request({
url: '/index.php?option=com_calculator&task=saveData',
method: 'post',
onSuccess: function (responseText, responseXML) {
console.log(reponseText);
}
})

当我运行它时,Firebug 抛出此错误:

Permission denied for <http://localhost> to get property XMLHttpRequest.channel

我已经阅读了周围的内容,认为它可能与 Ajax 的相同域策略有关,但我无法修复它。

最佳答案

试试这个:

var requestHTMLData = new Request.HTML ({

url: 'index.php?option=com_calculator&task=saveData',

update: $('contains')

}).send();

$('contains') 是您想要响应的 div id。

有关更多信息,请参阅 Gantry Framework

关于php - Joomla + Mootools XMLHttpRequest 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2288279/

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