WebView 忽略调用 PUT/DELETE Http 方法的 Javascript
我有一个 Web 视图,在它的 HTML/Javascript 中使用 Put/Delete 方法进行 Http 调用。这些调用似乎被忽略(我在 Chrome 上测试它们,它们工作正常)。
有什么想法吗?
下面是 WebView 内部的 JS 代码:
var req = new Backbone.Model(auth);
$.ajax({
type: PUT,
url: 'some_url',
data: JSON.stringify(req)
});
请注意,这是来自 jQuery 的 Ajax 调用。
I have a web view that in it's HTML/Javascript makes an Http call with Put/Delete methods. those calls seems to be ignored (I test them on chrome and they work fine).
Any idea?
Here's the JS code that inside the WebView:
var req = new Backbone.Model(auth);
$.ajax({
type: PUT,
url: 'some_url',
data: JSON.stringify(req)
});
Note that this is an Ajax call from a jQuery.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
WebView
忽略调用的原因是缓存。看来PUT/DELETE
调用已被缓存。以下是我为解决此问题所做的操作:
如您所见,我添加了一个新的
Date()
对象创建,以克服该缓存机制。感谢盖伊的帮助。您绝对应该查看他的博客 http://blog.guya.net/
The reason that the
WebView
ignored the call is because of caching. It seems that thePUT/DELETE
calls are cached.Here's what I did to solve this:
As you can see I added a new
Date()
object creation in order to overcome that caching mechanism.Thanks to Guy for helping out. You should definitely check out his blog at http://blog.guya.net/
你试过吗
have you tried