8000 Post/Response · Issue #38 · georges/porthole · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants
0