Chrome浏览器数据COM pression代理错误使用jQuery ajax的表单提交 [英] Chrome data compression proxy error with jquery ajax form submission

查看:220
本文介绍了Chrome浏览器数据COM pression代理错误使用jQuery ajax的表单提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个是被通过AJAX使用jQuery提交的表单一个简单的网页。在桌面浏览器提交时,它的形式工作正常,但形式使用Chrome浏览器已启用了铬数据通信pression代理功能的移动设备上,当提交的得到一个错误。

我收到以下错误信息:

  

该页面无法通过铬数据通信pression代理加载。尝试重新加载该页面。

做了一些摸索之后,有一些相似的问题,如的这个以及更值得注意的是这一个,但也很帮我。

本秒钟的问题是所谓的铬数据通信pression代理的领导回答我试过的建议,第二问题回答这对Cache-Control头设置为无转换。但是,这并没有区别。

有没有人有类似的问题,有一个工作围绕这个?

这是在code我使用提交表单:

  $。阿贾克斯({
    键入:POST,
    网址:服务/用户/ changePasswordUsingToken
    数据 : {
        令牌:道理,
        md5pwd:md5pwd
    },
    标题:{
        缓存控制:无转换
    },
    成功:函数(响应,textStatus,XHR){
        ...
    },
    错误:函数(XHR,状态,错误){
        警报(xhr.responseText); //该页面无法通过铬数据通信pression代理加载。尝试重新加载该页面。
    ...
});
 

解决方案

我是技术领先为镀铬COM pression代理。

此错误信息被发送时,代理服务器不能访问该网站出于某种原因 - 例如,一个DNS解析错误,或者该网站是不是在公共互联网上(例如,企业内部网)。通常情况下,对于GET请求的浏览器将能够自动重新加载URL,而不使用代理,但这是不可能的POST。

您可以提供说明在此网站托管一些更多的细节,无论是私网?我见过一对夫妇的这个报告,我想拿出一个通用的解决方案。谢谢你。

I have a simple web page with a form that gets submitted via ajax using jquery. The form works fine when submitting it on a desktop browser, but the form gets an error when submitted using Chrome on a mobile device that has the "chrome data compression proxy" feature enabled.

I get the following error message:

This page cannot be loaded via the "chrome data compression proxy. Try reloading this page.

After doing a bit of searching around, there are a few "similar" questions like this one and more notably this one, but neither quite help me.

The seconds question is supposedly answered by the lead of the "Chrome data compression proxy" I've tried the suggestion in the second questions answer which is to set the Cache-Control header to no-transform. But that made no difference.

Has anyone had similar issues and have a work around for this?

This is the code I'm using to submit the form:

$.ajax({
    type : "POST",
    url : "services/users/changePasswordUsingToken",
    data : {
        'token' : token,
        'md5pwd' : md5pwd
    },
    headers : {
        'Cache-Control': 'no-transform'
    },
    success : function(response, textStatus, xhr) {
        ...
    },
    error : function(xhr, status, error) {
        alert(xhr.responseText); //This page cannot be loaded via the "chrome data compression proxy. Try reloading this page.
    ...
});

解决方案

I'm the tech lead for the Chrome compression proxy.

This error message is sent when the proxy can't access the site for some reason - e.g., a DNS resolution error, or if the site is not on the public Internet (e.g., an intranet). Normally, for GET requests the browser would be able to reload the URL automatically without using the proxy, but this is not possible with POST.

Can you provide some more details on where this site is hosted and whether it's behind a private network? I've seen a couple of reports of this and I'd like to come up with a general solution. Thanks.

这篇关于Chrome浏览器数据COM pression代理错误使用jQuery ajax的表单提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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