Skip to content
Discussion options

You must be logged in to vote

An iframe has its complete own context. To accomplish your task you would have to call the toast from the iframes parent, so the whole viewport can be accessed again.

// Code in iframe.js running inside iframe webpage
window.parent.showToast();
// Code in parent.js running inside webpage where the iframe is embedded
function showToast(){
$('body').toast({message: 'i was called from the iframe!'})
}

The above mentioned approach does only work when the iframe and its parent share the same domain! If not, try to use window.postMessage instead

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by lubber-de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1675 on October 06, 2020 19:16.