Search code examples
javascriptjqueryajaxjsonp

JQuery modal dialog form that send data over https


I have already working modal login dialog. The problem is that if the origin page is loaded via http I still want to pass credentials to server via https. And of course I want to do with as little rewriting of working code as it can be.

I cannot use JSONP for my case because login data is passed to server via POST AJAX request.

Any ideas?


Solution

  • The Same Origin Policy makes this impossible (at least in browsers which don't support cross domain XHR, which is enough).

    (And since the host document is served over HTTP it is subject to interception and alteration on the wire, which would make the data vulnerable even if it was transported over SSL)