gpt4 book ai didi

javascript - qx.data.store.Jsonp : configureRequest not getting request as parameter

转载 作者:行者123 更新时间:2023-11-29 18:36:42 25 4
gpt4 key购买 nike

当像这样创建一个新的 qx.data.store.Jsonp 对象时......

var store = new qx.data.store.Jsonp(url, {
configureRequest: function(req) {
req.setParameter("key", "resources.appsrvs");
}
},"callback");

... 委托(delegate)函数 configureRequest 没有获取请求作为参数,如 qx.data.storeInterface.IStoreDelegate 中所述。那么我该如何配置请求呢?

最佳答案

不幸的是,这不是您想要的方式。 Jsonp 存储使用 ScriptLoader 对象,因为它是为跨域请求 设计的。因此使用了您的委托(delegate),但传递给它的“req”对象实际上是一个 qx.io.ScriptLoader 实例。请参阅 ScriptLoader 的 API 文档还有here了解更多详情。

如果您不打算进行跨域请求,请考虑改用 qx.data.store.Json。

关于javascript - qx.data.store.Jsonp : configureRequest not getting request as parameter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2501304/

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