admin管理员组文章数量:1391990
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 pression proxy" feature enabled.
I get the following error message:
This page cannot be loaded via the "chrome data pression 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 pression 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 pression proxy. Try reloading this page.
...
});
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 pression proxy" feature enabled.
I get the following error message:
This page cannot be loaded via the "chrome data pression 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 pression 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 pression proxy. Try reloading this page.
...
});
Share
Improve this question
edited May 23, 2017 at 12:09
CommunityBot
11 silver badge
asked Jun 14, 2014 at 4:42
julz256julz256
2,7521 gold badge17 silver badges12 bronze badges
3
- I have the same problem, hope for an answer! – Alfred Huang Commented Jun 19, 2014 at 8:49
- I think the "Cache-Control" header needs to be set on the server, rather than in the JavaScript. – Eddie Sullivan Commented Jun 27, 2014 at 18:01
-
@EddieSullivan,
Cache-Control
is available on both sides. It allows the client to request that none of the proxies/intermediate caches transform the data before it reaches the server. w3/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.5 – Alexis Wilke Commented Mar 28, 2016 at 5:05
2 Answers
Reset to default 4I'm the tech lead for the Chrome pression 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 e up with a general solution. Thanks.
I had the same problem by accessing local server from mobile by machine name, like: http://scabbiaza.local:3000
Started using access by IP and got rid off this issue.
本文标签: javascriptChrome data compression proxy error with jquery ajax form submissionStack Overflow
版权声明:本文标题:javascript - Chrome data compression proxy error with jquery ajax form submission - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744594571a2614695.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论