The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December. Read our blog post for more info about this change.
Found this content helpful? Log in or sign up to leave a like!
I want to redirect out of the LTI iFrame to the Canvas homepage. When the user presses the cancel button, the event sends the user to the canvas homepage but it is within the LTI iFrame. Does anybody know how to get out of the iFrame using javascript or C#?
Thank you,
Shawn
Solved! Go to Solution.
In HTML you can add the property target="_parent" to your <a> tags and it will open a link from an iFrame in the parent window of the iFrame. So it would look like
<a href="http://google.com" target="_parent">Click here.</a>
OR
In JavaScript:
window.parent.location.href= "http://www.google.com";
Read more at these links:
-html - how to force link from iframe to be opened in the parent window - Stack Overflow
-HTML link target Attribute
In HTML you can add the property target="_parent" to your <a> tags and it will open a link from an iFrame in the parent window of the iFrame. So it would look like
<a href="http://google.com" target="_parent">Click here.</a>
OR
In JavaScript:
window.parent.location.href= "http://www.google.com";
Read more at these links:
-html - how to force link from iframe to be opened in the parent window - Stack Overflow
-HTML link target Attribute
Thanks Matthew, that is very helpful!
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in