0

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!

Gregory
  • 51
  • 1
  • 9
  • Did you solve this somehow? The point is that window object is being replaced by the new window object created by easyXDM but I still can not find how to make a workaround. Thanks. – Alex Smirnoff Feb 09 '15 at 08:30
  • Privet, Alexey. Nope, I didn't. :-( – Gregory Feb 19 '15 at 20:51

0 Answers0