My web page is shown sometimes without container and sometimes inside an igDialog of another container page, depending on the navigation of the user inside our web application.
Is it possible (in pure javascript or jQuery) to detect from my page if I am inside an igDialog?
Hello Franco,
Thank you for using our community.
The straightforward approach that I can think of is using a parameter for the URL that you are loading when you use the igDialog. Something like this:
<div id="dialog">
<iframe src="http://ko.infragistics.com?indialog=true" frameborder="0" width="100%" height="100%"></iframe>
</div>
That way you can check if the parameter is set on the internal page when you are using the dialog. This is of course completely backend solution and not much to do with the dialog.
If you cannot alter the backend, client side options can also work with this parameter by accessing the document location from the inner page. Other options include setting parameters on the iframe container, but those usually rely on API-s that are not always compatible across all browsers.
Here are some resources on this topic that might help you achieve your goal:
http://stackoverflow.com/questions/935127/how-to-access-parent-iframe-from-javascript
http://stackoverflow.com/questions/2248951/access-iframe-name-from-inside-iframe
Regards, Marina Stoyanova, Software Developer, Infragistics, Inc.