IFRAME return currentURL from SAME DOMAIN

R

remo.trotta

I'm trying to use javascript in IE7 to return the current URL of an
IFRAME. Note that this is not the same as IFRAME.src property, which
returns the DEFAULT URL of the IFRAME. They are not not necessarily
the same value as user may have navigated to a different page from
within that IFRAME before the javascript runs.

Here is the code I am trying:

var currURL = IFRAME.contentWindow.location.href;

When I do this a I get a "permission denied" error, which would be a
normal IE security trap if I were cross-frame scripting to another
domain, but in this case, it is always within the SAME domain. How do
I make IE see that and allow this command to override the cross-
scripting security?

Here are more details:

Assume that domain "ABC.com" has 2 application servers that run web
apps (both 3rd Party applications). In order to access these apps, we
use internal DNS server names, NOT FULLY QUALIFIED DOMAIN NAMES. for
example:

APPLICATION A = http://AppA:5555/loader.aspx (which is actually the
same as http://AppA.ABC.com:5555/loader.aspx)

APPLICATION B= http://AppB:8888/start.html (which is actually the same
as http://AppB:8888/start.html)

Application "A" is Microsoft Dynamics CRM 3.0. It allows users to
customize the product. One of the customizations that I am currently
working on is a form that contains an IFRAME which points to "http://
AppB:8888/start.html" as it's default start page.

The idea is that when a user launches the CRM form, ApplicationB is
also launched in an IFRAME, in the same workspace, thus creating the
illusion of an integration.

Once inside the IFRAME, users will navigate around and use AppB from
inside the CRM form. Before they close CRM, there is an OnSave event
which should use IFRAME.contentWindow.location.href to return the
current URL of the IFRAME and then SAVE that in the CRM database so
that next time that form is opened again, it can reference the stored
URL as the new IFRAME.src value, and it will take the user back to the
last place where they left off in ApplicationB when they saved their
work in CRM.

At no point in this example does a user ever leave the ABC.COM domain,
yet it still seems that there is something preventing the cross-frame
scripting? Can anyone please help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top