0

I am currently working on a PlayCanvas project which is going to be embedded in an iFrame inside a slideshow(Articulate Storyline). The slideshow application lets me use Javascript by using:

player.SetVar("Result",score);

where player is:

parent.getPlayer();

The structure ends up being, each being a child of the former:

  • Main html file(slideshow)
  • iFrame (with source on the same domain)
  • Canvas
  • JS script inside PlayCanvas application

My main problem here is that I can't call getPlayer() without accessing the iFrame, but parent.document.getElementById('') returns null. I feel like I'm overlooking something very obvious but I can't get it working.

Thanks in advance, and if my formatting/question is incorrect please let me know so I can update the post!

Wilrick B
  • 135
  • 8
  • Iframe is new document in your document. You can try something like `var iframe = window.getElementsByTagName( "iframe" )[ 0 ]; iframe.document.getElementById("");`. But it is better to use events between you iframe and your document. – Dani R Jun 28 '21 at 11:58

1 Answers1

1

Well, found the issue, Articulate uses GetPlayer() instead of getPlayer(), cost me way too long to figure that out.

Wilrick B
  • 135
  • 8