Comments on: Remote Procedure Calls (RPC) https://easyxdm.net/wp/2010/03/17/remote-procedure-calls-rpc/ Cross-Domain Messaging made easy Thu, 20 Apr 2017 18:47:42 +0000 hourly 1 https://wordpress.org/?v=4.9.34 By: Ken Deeds https://easyxdm.net/wp/2010/03/17/remote-procedure-calls-rpc/comment-page-1/#comment-1428 Wed, 24 Apr 2013 15:30:00 +0000 http://easyxdm.net/blog/?p=14#comment-1428 “Hey this is a free great tool, if you don’t like it just don’t use it and don’t disturb” – really, if someone points out the examples are fairly weak and short they get told don’t disturb. Really would it be that hard to set up an example where a parent page changes the background color of a child page in an iframe or something like that? How about an example with a link where I can actually see it work.

]]>
By: Asd https://easyxdm.net/wp/2010/03/17/remote-procedure-calls-rpc/comment-page-1/#comment-1221 Sat, 22 Dec 2012 05:12:00 +0000 http://easyxdm.net/blog/?p=14#comment-1221 adsf asdfasdf

]]>
By: wxttt https://easyxdm.net/wp/2010/03/17/remote-procedure-calls-rpc/comment-page-1/#comment-1128 Wed, 01 Aug 2012 12:13:00 +0000 http://easyxdm.net/blog/?p=14#comment-1128 how to post an array?

]]>
By: cTux https://easyxdm.net/wp/2010/03/17/remote-procedure-calls-rpc/comment-page-1/#comment-1080 Wed, 30 May 2012 06:25:00 +0000 http://easyxdm.net/blog/?p=14#comment-1080 xhr.post(url, {}, function(data){
alert(1);
});

Why i haven’t alert(1)?:(

]]>
By: Øyvind Sean Kinsey https://easyxdm.net/wp/2010/03/17/remote-procedure-calls-rpc/comment-page-1/#comment-1062 Fri, 04 May 2012 18:52:00 +0000 http://easyxdm.net/blog/?p=14#comment-1062 easyXDM’s RpcBehavior will happily offload incoming JSON-RPC messages to a handler, https://github.com/oyvindkinsey/easyXDM/blob/master/src/stack/RpcBehavior.js#L187.

This handler will be passed the incoming message as well as a function to send back the response.

You can probably write a glue component to hook this into an ajax enabled backend in not to many lines of code..

]]>
By: lvh https://easyxdm.net/wp/2010/03/17/remote-procedure-calls-rpc/comment-page-1/#comment-1059 Fri, 04 May 2012 17:06:00 +0000 http://easyxdm.net/blog/?p=14#comment-1059 I’m exposing a JSON-RPC API. I’d like to consume it cross-domainly in browsers, even crappy ones.

Is there an example or documentation I need to read to understand how I can convince easyXDM to do this JSON-RPC? IIUC I basically just need to write a lot of AJAX calls in the producer side, but it seems like a lot of boilerplate, and IIUC easyXDM already uses JSONRPC anyway.

]]>
By: Bahri Alireza https://easyxdm.net/wp/2010/03/17/remote-procedure-calls-rpc/comment-page-1/#comment-1008 Tue, 07 Feb 2012 21:44:00 +0000 http://easyxdm.net/blog/?p=14#comment-1008 Great tool. 

But I have run into the same issue xiaohan2012 has mentioned. My function on the provider gets called correctly. But then if I want to change the DOM on the provider side (like simply change the innerHTML of a div tag, it won’t work with no errors I can see. But the same function does alerts correctly.

Here is the provider code:

var provider = new easyXDM.Rpc({}, {
local: {
updateCart: {
method: function(url, message, fn, fnError) {
var message = “This message is coming from ” + url;
testFunctionA(message);
//return message;
throw new Error(“something happened!”);
}
}
}
});

function testFunctionA(message) {
try {
document.getElementById(‘messageDiv’).innerHTML = message;
alert(message);
} catch(e) {
alert(e.message);
}
}

and the consumer code:

var consumer = new easyXDM.Rpc({
remote: “domainA_rpc.html”
}, {
remote: {
updateCart: {}
}
});

function updateCartOnRemote(message) {
consumer.updateCart(“domainB_rpc.html”, message, function() {
alert(‘Update was successful’);
}, function() {
alert(‘Update was not successful’);
}
);
}

]]>
By: Anonymous https://easyxdm.net/wp/2010/03/17/remote-procedure-calls-rpc/comment-page-1/#comment-990 Fri, 13 Jan 2012 13:49:00 +0000 http://easyxdm.net/blog/?p=14#comment-990 I am encountering problem using easyXDM RPC.

My requirement is like this:

    The consumer passes the content as parameter and calls the function through RPC. 
    The provider receives the request and use the content to modify its page.

Here, *modifying its page* means trying to modify the DOM structure or the content in the DOM node.

The code for the **provider** side, which will modify its page content once requested by the consumer.

    var provider = new easyXDM.Rpc({}, {
        local: {
            modifyContent: {
                method: function(content){
                    // modify the content on my page
                }
            }
        }
    });

The **consumer** side, which will perform RPC to ask the provider to change its page.

        var consumer = new easyXDM.Rpc({
            remote: “remoteUrl”
        }, {
            remote: {
                modifyContent: {}
            }
        });
        //perform RPC and ask the provider to the modify its content
        consumer.modifyContent(“This is some content that should be used to modify your content”);

All things go on well excepts when the provider tries to use the content to modify its page.

No errors nor warnings are raised. But the page just won’t change as expected.

Besides, I run the “change content” code alone(like copy&paste&run in Firebug console or Chrome console), it will work.

]]>
By: Anonymous https://easyxdm.net/wp/2010/03/17/remote-procedure-calls-rpc/comment-page-1/#comment-987 Fri, 13 Jan 2012 13:48:00 +0000 http://easyxdm.net/blog/?p=14#comment-987 I am encountering some problem in using easyXDM RPC.
My requirement is like this:

    The consumer passes the content as parameter and calls the function through RPC. 
    The provider receives the request and use the content to modify its page.

Here, *modifying its page* means trying to modify the DOM structure or the content in the DOM node.

The code for the **provider** side, which will modify its page content once requested by the consumer.

    var provider = new easyXDM.Rpc({}, {
        local: {
            modifyContent: {
                method: function(content){
                    // modify the content on my page
                }
            }
        }
    });

The **consumer** side, which will perform RPC to ask the provider to change its page.

        var consumer = new easyXDM.Rpc({
            remote: “remoteUrl”
        }, {
            remote: {
                modifyContent: {}
            }
        });
        //perform RPC and ask the provider to the modify its content
        consumer.modifyContent(“This is some content that should be used to modify your content”);

All things go on well excepts when the provider tries to use the content to modify its page.

No errors nor warnings are raised. But the page just won’t change as expected.

Besides, I run the “change content” code alone(like copy&paste&run in Firebug console or Chrome console), it will work.

]]>
By: Pabletec https://easyxdm.net/wp/2010/03/17/remote-procedure-calls-rpc/comment-page-1/#comment-870 Wed, 14 Sep 2011 23:03:00 +0000 http://easyxdm.net/blog/?p=14#comment-870 Hey this is a free great tool, if you don’t like it just don’t use it and don’t disturb

]]>