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 7688769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:59:59+00:00 2026-05-31T19:59:59+00:00

I am coming from Java and try to learn Javascript right now. Doing that

  • 0

I am coming from Java and try to learn Javascript right now. Doing that I have a problem to understand some behaviour I wrote.

I like to have two windows. caller.html opens called.html and invokes a function called printMe().

This is my code for caller.html:

<html>
<head>
    <title> PDSA #4.1 : Page 1 - Communication between Windows </title>
</head>
<body>
    <script>
        fenster = open("called.html");
        fenster.printMe();
    </script>
</body>

and this is called.html:

<html>
<head>
    <title> PDSA #4.1 : Page 2 - Communication between Windows </title>
    <script>
        function printMe() {
            ausgabe = document.getElementById("toChange");
            ausgabe.innerHTML += "Changed!";
        }
    </script>
</head>
<body>
    <div id="toChange"></div>
</body>

Nothing happens when called.html is opened and from The Javascript Console in Chrome I can see the following error:

Uncaught TypeError: Object [object DOMWindow] has no method 'printMe'
(anonymous function)

Newbish as I am I don’t get it – why is printMe not found? The function is there and I see it in the code. Can you point me to the error?

Thanks in advance for any hints
André

  • 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-31T20:00:00+00:00Added an answer on May 31, 2026 at 8:00 pm

    if you use jquery, do it inside of, this would make your life easier..

    // on the second page
    $(document).ready(function() {
      printMe();
    });
    

    or maybe this would work:

    // on the first page
    fenster = open("called.html");
    $(fenster.document).ready(function(){
       fenster.printMe();
    });
    

    if it’s not working, you can call setTimeout before calling the function to make sure the child window done loading

    // on the first page
    fenster = open("called.html");
    setTimeout(function(){
       fenster.printMe();
    },2000);  // 2 seconds before invoking (increase if not enough)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Coming from Java , I'm used to the package structure (com.domain.appname.tier) Now I've started
I just started learning C++ (coming from Java ) and am having some serious
I have this code in java : try{ //some code here.. . } catch
I'm coming from Java/C++ to Ada and am having trouble figuring out the small
I'm coming from Java, where I'd submit Runnable s to an ExecutorService backed by
Note: I'm relatively new to Objective-C and am coming from Java and PHP. Could
Coming from a Java background, this is the way I'm thinking: The server provides
Coming from a Java background, this is the way I'm thinking: The server provides
I'm coming from the Java world and are building a small c++ program at
I'm very new to Python (I'm coming from a JAVA background) and I'm wondering

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.