user217896
user217896

Reputation:

jquery ajax post to non-ssl page while current page is ssl

Ok, situation:

getting no usefull response

the same scenario, non-ssl to non-ssl works perfect.

I can view my console, but cant get any usefull info from it why the request fails...

$.ajax({

type: "POST",
url: form.attr("action"),
data: form.serialize(),

error:          function(res){ console.log(res) },
notmodified:    function(res){ console.log(res) },
parsererror:    function(res){ console.log(res) },
timeout:        function(res){ console.log(res) },
success:        function(res){ alert('succes!'); }

});

Upvotes: 1

Views: 5077

Answers (1)

ZZ Coder
ZZ Coder

Reputation: 75456

You can't make AJAX calls from non-SSL page to a SSL URL. This violates the SOP (Same Origin Policy) because the protocols (HTTP vs HTTPS) are different. Some old browsers don't have this restrictions but all new ones enforce this now.

Read this article for more details,

http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/FAQ_SOP

Upvotes: 7

Related Questions