Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
This repository was archived by the owner on May 22, 2025. It is now read-only.

Post/Response #38

@ghost

Description

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions