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

  • Home
  • SEARCH
  • 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 6208775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:51:58+00:00 2026-05-24T05:51:58+00:00

* Update: Ultimately I’ve decided that accomplishing exactly what I want here isn’t possible

  • 0

*Update: Ultimately I’ve decided that accomplishing exactly what I want here isn’t possible due to the issues it poses to security. Kalle’s answer below gives a solution that is closest to what I want to accomplish.
In order to solve my problem I’ve created scripts on both pages and will use a sort of push notification that is routed through the server in order for them to communicate.
Thanks for the help!! *

I have two pages. Both windows already exist independently. Page two has a function declared in JS.

I would like to be able to call the function in window two by clicking a link in window one.

Page 1:

<html>
<head>
<title>This is a title!</title>
</head>
<body style="background: lightblue">

<a href="#" target="my_target" onClick="clicked()">Click Me!</a>

</body>

Page 2:

<html>
<head>
<META HTTP-EQUIV="Window-target" CONTENT="my_target" />
<title>This is a title!</title>
<script type=text/javascript>
    function clicked() {
    alert('test');
    }

</script>
</head>
<body style="background: lightblue">



</body>
  • 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-05-24T05:51:59+00:00Added an answer on May 24, 2026 at 5:51 am

    Ok, brand new answer. I hope this is what you were thinking. This is however, when you open page 2 from page 1.. So basically, page 1 would know who page 2 is..

    Online example: http://kopli.pri.ee/stackoverflow/6832271.php

    Page 1

    <html>
    <head>
        <title>Page 1</title>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
        <style>
            .ajaxlink {color: blue; cursor: pointer; border-bottom: 1px dotted blue;}
        </style>
    </head>
    <body>
    
        <span id="open_page_2" class="ajaxlink">Open new window</span>
    
        <br>
        <br>
    
        <a href="#" target="my_target">Click Me!</a>
    
        <script>
        $('#open_page_2').click(function(){
            child = window.open('test2.php','page_2','width=600,height=600');
        });
    
    
        $('a[target=my_target]').click(function () {
            child.SecondPageFunction();
            return false;
        });
        </script>
    </body>
    </html>
    

    Page 2

    <html>
    <head>
        <title>Page 2</title>
    </head>
    <body>
    
        <h1>Your seeing page 2!</h1>
    
        <script>
            function SecondPageFunction () {
                alert('Second page action got triggered!');
            }
        </script>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ultimately I want to create a desktop app that allows users to update their
So I have a form that I want the user to use to update
(Assuming it's even possible in .Net, of course.) Ultimately, what I want to accomplish
using Visual.Web.Developer.2010.Express; using SQL.Server.Management.Studio.2008.R2; What I'm ultimately trying to do is update a sql
Update In the wiki spirit of StackOverflow, here's an update: I spiked Joe White's
I'm trying to update some existing code that normally runs a Perl script which
I've got some heavily modified code that ultimately came from the Windows Media SDK
I'm ultimately trying to install PEAR so I can easily install PHPUnit. I want
I want to send a request via Viralheat's API in my controller's update method
I'm not even sure if this is possible or not, but here's what I'd

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.