How to get ASSETS_URL from a iframe

image

Sorry. I don’t understand the issue. Could you write in more detail what you’re trying to achieve?

I use a iframe tag with src is a shapespark link, when render the viewer the iframe will have a content body and include the script contain assetsUrl, I use theIframe2.contentWindow.document.body.innerHTML to get the body content but it was blocked. The purpose I want to have it is so that when the user enters any shapespark link, I will get the assetsUrl.

It’s not possible to access the content of the iframe from the parent page, if the parent page and iframe have different origins. There are ways to communicate the pages if you control both of them, though. See: javascript - Cross domain iframe issue - Stack Overflow

1 Like