I have the following problem:
I use EasyXDM to make AJAX calls between 2 domains. However, when I use socket.postMessage() from a jQuery function it just doesn't fires.
Here's an example:
var socket;
socket = new easyXDM.Socket({
remote: "http://domain.com/provider.php",
onReady: function() {
}
});
// STEP1
socket.postMessage('step1');
$('#form').submit(function(e){
e.preventDefault();
var a = {}
a['login'] = $('input[name=login]').val();
a['password'] = $('input[name=password]').val();
$.ajax({
type: "POST",
url: "/astr/auth.php",
data: a
}).done(function(answer){
// STEP2
socket.postMessage('step2');
});
});
In this example STEP1 sends a message to provider correctly but in STEP2 it doesn't even fires.
I tried to use window.socket, etc. No luck. And I 100% sure that done(function(answer){}) fires correctly.
Thanks in advance!