Requirement is to navigate to site home page on Exit click.
I have thought of following :
1. Navigating in app code will only navigate in the iframe.
2. content editor js will not be able to access the elements in iFrame.
Please suggest what options i have.
Hi Mohit,
From your description, my understanding is that you want to redirect to SharePoint site from provider hosted app.
As you mentioned in your description, provider hosted app is in an iframe, if you want to redirect to SharePoint site, the app need to redirect the parent page from iframe. Please refer to this code below:
function exitClick(){ //replace your home page URL window.parent.location.href="https://milesli.sharepoint.com/sites/DevSite"; } <input type="button" value="exit" onclick="exitClick()"/>
Here are some articles about redirecting the parent page from iframe:
Redirect parent window from an iframe action
http://stackoverflow.com/questions/580669/redirect-parent-window-from-an-iframe-action
Redirect the parent page from Iframe
http://stackoverflow.com/questions/2092275/redirect-the-parent-page-from-iframe
Best Regards,
Vincent Han