tags:

views:

745

answers:

1

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?

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

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?

Thanks!

+1  A: 

Attempting to switch protocols will violate the same origin policy.

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.

sgriffin
The browser would block access, but you can use postMessage() in the more recent browsers to communicate with the iframe.
Anne