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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:31:14+00:00 2026-05-11T21:31:14+00:00

I have a simple ajax application From this, a popup is launched, with a

  • 0

I have a simple ajax application

From this, a popup is launched, with a form.

Both the form resultpage, and the ajax application hava a javascript file in common.

From the popup window, in the form resultpage, I am trying to call a method from the common javascript file, to apply to the parent window.

My javascript file contains an updateLayer method, which when caleld from the parent window, works fine. I get nothing when trying to call it from the popup window.

The resultpage in the popup window has

<script type="text/javascript" src="x.js">window.opener.updateLayer("Layer3", "380118179930"); </script>

before any html.

Nothing happens in the parentwindow. I have also tried window.parent.

What is the reason and solution for/to this?

  • 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-11T21:31:14+00:00Added an answer on May 11, 2026 at 9:31 pm

    I assume this is related to this question, asked by another user that also happens to be named Josh.

    In my answer to that question, I tried to explain that the functions from a Javascript file included in your parent window would be attached to the window object, so you use window.opener to get access to that window object to call them.

    It looks like you’ve almost got this solved, but the problem here is that by including src="x.js" in the script tag from your form response, you’re effectively overwriting any code placed inside the script. Plus, since x.js is included in the parent window, there’s no need to have it in the popup at all, anyway.

    The code for your form response should look like this:

    <script type="text/javascript">
    window.opener.updateLayer("Layer3", "380118179930");
    </script>
    

    I’ve removed the src="x.js" attribute, which would otherwise prevent code between the <script></script> tags from being executed.

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

Sidebar

Related Questions

I had a realtivley simple ajax application, which I have broken up to be
hi i created a simple php/mysql/Ajax chat application and I have a few questions.
I'am building simple Ajax application (via jquery). I have strange issue. I found where
I have seen simple example Ajax source codes in many online tutorials. What I
I have a simple HTML. I am using the JQuery for AJAX purpose. Now,
I have a simple 2-column layout with a footer that clears both the right
I have a simple ajax request that I am trying to call a web
I have simple regex \.*\ for me its says select everything between and ,
Ok, i have simple scenario: have two pages: login and welcome pages. im using
In general, is it a best practice to have simple POJO Java classes implement

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.