Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post/Response #38

Open
ghost opened this issue Jun 11, 2015 · 0 comments
Open

Post/Response #38

ghost opened this issue Jun 11, 2015 · 0 comments

Comments

@ghost
Copy link

ghost commented Jun 11, 2015

Great tool! I was wondering if there has ever been discussion about how to receive data back from a child frame immediately after a post from the parent frame. Example:

Parent Frame, in some type of mootools/jquery class-like object:

getDataForThing: function(thingId){
    var post = this.proxy.post({ // posts to a child frame
        cmd: 'getDataForThing',
        thingId: 1
    });
       console.log(post) // {data: 123}
}

Then, maybe in the child Frame logic:

proxy.addEventListener(function(event) {
    switch (event.data.cmd){
        case 'getDataForThing':
            var data = 123;
            return data;
            break;
    }
});

Admittedly, I know very little about the underlying tech that makes this possible, but there's always hope for something creative! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants