可以通过端Ajax HTTP和HTTPS工作的一面呢? [英] Can Ajax HTTP and HTTPS work side by side?

查看:222
本文介绍了可以通过端Ajax HTTP和HTTPS工作的一面呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设使用AJAX对所有服务器的交互,是有可能使用HTTP的常规数据传输,然后切换到安全的数据传输AJAX方式HTTPS请求通过HTTP访问最初的单个页面的应用程序?

Assuming a single page application accessed initially via HTTP that uses AJAX for all server interaction, is it possible to use HTTP for regular data transfers and then switch to AJAXian HTTPS requests for secure data transfers?

如果是这样,如何​​将浏览器处理证书和锁定通知时,一个HTTPS AJAX请求是?

If so, how would the browser handle the certificate and locking notification when a HTTPS AJAX request was made?

如果这是不可能的,那么有没有什么解决方法在同一页面内混合AJAX HTTP和HTTPS AJAX例如加载一个iFrame的HTTPS?

If this is not possible, then are there any workarounds to mixing AJAX HTTP and AJAX HTTPS within the same page such as loading an iFrame for HTTPS?

谢谢!

推荐答案

试图切换协议将违反的同源策略

Attempting to switch protocols will violate the same origin policy.

我不知道如何使用iFrame中一个解决方法是行为,但我认为浏览器可能会阻止访问被加载HTTPS框架,也是因为同根同源的政策。

I am not sure how a workaround using iFrames would behave, but I think the browser may block access to the frame that was loaded as HTTPS, again due to the same origin policy.

这篇关于可以通过端Ajax HTTP和HTTPS工作的一面呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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