简体   繁体   English

Javascript-经过一段时间的SSL取消AJAX请求

[英]Javascript - AJAX Request Cancelled after a While over SSL

I am using the Prototype JS framework to do AJAX calls over an SSL connection. 我正在使用Prototype JS框架通过SSL连接进行AJAX调用。 At first, the AJAX performs fine. 首先,AJAX表现不错。 However, if the page is live for more than 10 seconds or so, the AJAX requests fail to return successfully and have a status of 0, or 'canceled' in the Network Inspector... 但是,如果该页面的活动时间超过10秒左右,则AJAX请求将无法成功返回并且状态为0,或者在网络检查器中被“取消” ...

在此处输入图片说明

This happens across multiple browsers and I've tried other solutions relating to .gz files, all to no avail. 这种情况发生在多个浏览器上,我尝试了与.gz文件有关的其他解决方案,但都无济于事。

Another hints is that once the AJAX requests begin to fail, the green lock symbol turns to a grey triangle with a warning symbol (insecure content). 另一个提示是,一旦AJAX请求开始失败,绿色锁定符号就会变成带有警告符号的灰色三角形(内容不安全)。 Any pointers please? 有指针吗?

The AJAX requests were being redirected by our european switcher. 我们的欧洲切换台正在重定向AJAX请求。 Changed this: 改变了这个:

   $clearCurrentUrl = str_replace(array('/index.php'), '', Mage::helper('core/url')>getCurrentUrl());
   $clearRedirectUrl = str_replace(array('/index.php'), '', $redirectUrl);

to this... 为此...

   $clearCurrentUrl = str_replace(array('/index.php', 'https://', 'http://'), '', Mage::helper('core/url')->getCurrentUrl());
   $clearRedirectUrl = str_replace(array('/index.php', 'https://', 'http://'), '', $redirectUrl);

And it works a charm now! 现在,它的魅力! :) Thx folks. :) Thx乡亲。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM