Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8809257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:49:38+00:00 2026-06-14T02:49:38+00:00

My main goal is: Going to my application, open a link there in a

  • 0

My main goal is:

Going to my application, open a link there in a new tab, make something in the new tab and send an event to the parent-main tab to refresh.

I have learned 2 techniques that doesn’t do exactly what I need:

  1. postMessage – works as far as I know only on iframe and not on tabs
  2. window.opener – works only with window.open(url) that opens only new window and not new tab.

How can I pass an event from the child to the parent using tabs? I’d be happy for a specific example for javascript code in the parent and the child. It should work for cross-domain (for example: http://www.mydomain.com and bills.mydomain.com).

Is there a a jQuery solution I am missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:49:40+00:00Added an answer on June 14, 2026 at 2:49 am

    The following works for me in chrome, firefox, ie(didn’t test more browsers)

    assume 3 documents

    1. (http://www.mydomain.com/parent.html)the page that contains the ‘main’-document with the link
    2. (bills.mydomain.com/child.html)the page that will be opened by the link
    3. (http://www.mydomain.com/dispatcher.html)explained later

    at first set the domain-property of all 3 documents to mydomain.com

    <script>
    document.domain="mydomain.com";
    </script>
    

    in parent.html create a hidden iframe with a name-property of e.g. “hiddenframe”. Also create some function that may later receive a response.

    parent.html should now look like this:

    <script>
    document.domain="mydomain.com";
    function fx(msg)//receives the response
    {
      alert(msg)
    }
    </script>
    <iframe name="hiddenframe" style="display:none"></iframe>
    <a href="http://bills.mydomain.com/child.html" target="_blank">click</a>
    

    In child.html you’ll now be able to load a document into the hidden iframe inside parent.html

    <script>
    document.domain="mydomain.com";
    window.open('http://www.mydomain.com/dispatcher.html','hiddenframe');
    </script>
    

    (don’t be confused in face of the use of window.open() here, there will not open a new window, the page will be loaded into the iframe in parent.html)


    In dispatcher.html you now may call the function inside parent.html

    <script>
    document.domain="mydomain.com";
    parent.fx('you just got some response');
    </script>
    

    When you only need to reload the parent.html it’s a little bit easier.

    Again set the document.domain-property in parent.html and child.html(you don’t need the iframe in parent.html and the dispatcher.html)

    In parent.html also set the name-property of the window, e.g.

    <script>
      window.name="parentTab";
    </script>
    

    In child.html you now may access the parentTab-window(tab)

    <script>
        document.domain="mydomain.com";
        window.open('http://www.mydomain.com/parent.html','parentTab');
    </script>
    

    …or simply use “parentTarget” as target-property of a link or form in child.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm revamping an apache-php application. The main goal is to make it easily portable
I have an application thats main goal is to play a specific video file.
For homework, I need to build a small java application.The main goal is to
I've recently started my new private project. The main goal which I want to
Is there a Maven phase or goal to simply execute the main method of
Main goal: To have two builds of the same application on my phone. What
In this project there is going to be two .exe files: Main, in this
My goal I'd like to make an application for PlayBook (using Flex) that has
The main goal is to let users send message to the host. The host
My main goal is to check an FTP server at anytime for a new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.