We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Can V3d receive window.postMessage events?

Home Forums General Questions Can V3d receive window.postMessage events?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #31520
    Avatargrimmy
    Newbie

    I am told this is a good way to communicate between iframes and the current page but I cant find anything in puzzle to listen to such events.

    Is there a way?

    Thanks

    #31534
    Yuri KovelenovYuri Kovelenov
    Developer

    Hi,

    there is no such puzzles yet, sorry, but you can implement this with JavaScript and link with the Puzzles as show here:
    https://www.soft8soft.com/docs/manual/en/introduction/Using-JavaScript.html

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

    #31551
    Avatargrimmy
    Newbie

    Thanks for this but I tried a few variations and cant get it to work. Maybe my situation is slightly different to those described in the manual(?):

    I have a parent app which has the verge3d app embedded as an iframe. I want the parent app to perform some function on the v3d<iframe>. Im using postMessage from the parent app to send something to the iframe but I’m just not sure how the v3d iframe picks up the message.

    #31553
    Avatargrimmy
    Newbie

    I have the solution for anyone wishing to try the same thing:

    In my parent app I send the message like so:

    In my awesom_application.js script I make a message listener like so:

    However I still don’t know how I would go about sending more data (variables) to the v3d window…if anyone has any ideas let me know..

    • This reply was modified 1 month ago by Avatargrimmy.
    #31557
    Avatargrimmy
    Newbie

    In order to send a bunch of data to the v3d iframe you can do this:

    Parent:

    v3d iFrame (in my_awesome_app.js for example):

    #31573
    Yuri KovelenovYuri Kovelenov
    Developer

    Awesome! Thank you for sharing your solution! :good:

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.