I have a form that takes three steps to fill it. At each of these steps you fill some info, click "Next" and then see either errors you have to fix in order to get to the next step or if there are no errors it takes you to the next step (change "display" to "block" in CSS).
At first step it uses $.ajax() to call file lib/ajax.php which returns some results in JSON that matter a lot to filling the rest of the form. The thing is this works locally on my http://my.dev address, but live on https://something.example.com it does not.
Where should I first try looking to go about it? What are the most common workarounds on this?
Both lib/ajax.php and the index.php file (that has the jQuery call) are on the same domain (https://something.example.com) so we are not talking about cross-domain calls.
Here's some of the code.
$.ajax({
type: 'GET',
url: 'lib/ajax.php',
async: false,
data: {id: id},
dataType: 'json', // what type of data do we expect back from the server
}).done(function(data){
// do stuff with data
});
and the lib/ajax.php
//stuff with db and retrieving row by id
header('Content-type: application/json');
echo json_encode($result);
That's pretty much it. It doesn't work when I place it on live HTTPS server.