SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard rozner's Avatar
    Join Date
    Oct 2002
    Location
    Paris
    Posts
    1,058
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    need help with child window calling parent function

    Hi,

    I'm not even sure if this is possible anymore since I get permission denied no matter what I try.

    I have a form with a bunch of info and theres a combo box with acronyms. Then we have a link that pops up a page with the full names of the acronyms. A user is supposed to be able to click on the full name, then the popup closes and automatically selects that acronym, sounds easy enough, so I thought. My first attempt went like this:

    Code JavaScript:
            function setAcronym(acronym) {
                self.opener.document.getElementById('acronymList');
                var index = getAcronymIndex(acronymBox, acronym);
                if (index != -1) {
                    acronymBox.selectedIndex = index;
                }
                window.close();
            }

    Firefox JS console says permission denied

    Then I tried doing all the heavy stuff in a function in the parent page and just used this in the popup.


    Code JavaScript:
            function setAcronym(acronym) {
                window.parent.setAcronym(acronym);
                window.close();
            }

    Again, permission denied. For the moment I'm stuck on this. Any suggestions?

    Thanks

  2. #2
    SitePoint Wizard rozner's Avatar
    Join Date
    Oct 2002
    Location
    Paris
    Posts
    1,058
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok looks like I found the problem, since I didn't write this site, just doing updates for them, the popup was named _blank, so I gave a more unique name and it works now, sort of, I get other errors, but those I can fix

  3. #3
    SitePoint Wizard rozner's Avatar
    Join Date
    Oct 2002
    Location
    Paris
    Posts
    1,058
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok I was wrong, that actually made no difference in the end, the same problem still exists. Is there any way around this permission denied problem?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •