0
votes

We have a corporate website which has an iFrame within a page pointing to my XPage.

The problem I have is that the same XPage is also used in another iFrame (different page) and I need to clear some Scope variables on beforePageLoad event.

Using SSJS; how can I get the parent window url for my iFrame content?

Example:

Corporate page #1 = http://mycompany.com/training-courses

Corporate page #2 = http://mywebsite.com/training-ilo

Both pages have an iFrame pointing to http://dominoserver/myapp.nsf/xHome.xps

1

1 Answers

3
votes

Unless your domino server domain is the same as the parent sites, you will not be able to access information from those pages.

Your best bet is to supply a url parameter to the src of the iframe:

<iframe src="http://dominoserver/myapp.nsf/xHome.xsp?site=xyz"></iframe>

Then, in your ssjs of your xpage you can grab the url information using the XSPUrl class:

var url : XSPUrl;
url = context.getUrl();
var site = url.getParameterName("site");