views:

786

answers:

1

Ok, situation:

  • an https / ssl page
  • jquery
  • a form
  • submitted via ajax to a non-ssl pagge

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!'); }

});

+1  A: 

You can't make AJAX calls from non-SSL page to a SSL URL. This violates the SOP (Same Origin Policy) because the ports 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%5FSOP

ZZ Coder
doh, I knew that!Talking about a tunnelvision...thanks!
Rob