Web Analytics Made Easy -
StatCounter Referencing "Source" in Parent Window - CodingForum

Announcement

Collapse
No announcement yet.

Referencing "Source" in Parent Window

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Referencing "Source" in Parent Window

    Hi,

    I am trying to use information in a parent window for processing in a child window. Both pages are using HTTPS.

    It works in HTTP but in HTTPS I am getting an access denied error.

    Here is the code I am using:

    script language="jscript">
    //var coll=window.parent.document.all.tags("td");
    alert(window.opener.location.href);
    var coll=window.opener.document.all.tags("td");
    //var coll=window.opener.all.tags("table");
    //var coll=window.opener.document.all.tags("td");
    if(coll!=null)
    {
    //alert(coll.length);
    for(j=0;j<coll.length;j++)
    {
    //alert(coll[i].innerText);
    var r, re;
    //alert(coll[j].innerText);
    var s=coll[j].innerText;
    re = /Patient:/i;
    r=s.match(re);
    if(r=='Patient:')
    {
    //alert(s.replace(re,""));
    document.frm.Patient.value=s.replace(re,"");
    }
    s=coll[j].innerText;
    re = /User:/i;
    r=s.match(re);
    if(r=='User:')
    {
    //alert(s.replace(re,""));
    document.frm.User.value=s.replace(re,"");
    }
    }
    }
    </script>

  • #2
    I do not believe you can do that.
    Why don't you pass the info from the parent to the child when the child is opened?

    .....Willy

    Comment


    • #3
      Referencing &quot;Source&quot; in Parent Window

      Hi Willy,

      I can't pass parameters because the parent page is on my customer's server and is a dynamically generated page from their vendor's system.

      We are trying to interface our system to theirs so that users don't have to log in twice.

      Also the link on the parent page which would open the child page is on two different domains:
      a) parent page on their domain
      b) child page on our domain

      I basically need to capture some text from the parent window which has already authenticated the user, so I can continue to deliver an authenticated session.

      PanHealth

      Comment


      • #4
        I was even surprised you made it worked with http. It's a violation of same origin policy or cross-domain security. But what do you expect from IE and JScript?
        Glenn
        vBulletin Mods That Rock!

        Comment

        Working...
        X