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 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 have a simple jsp/servlet application and I want to add AJAX feature to
I have made a simple chat application in PHP/Ajax/MySQL. I am regularly calling these
I used to have a simple ajax that helped me take all items from
I have written a simple jQuery.ajax function which loads a user control from the
I have a simple form at my site which sends it data via Ajax
I have created an Ajax enabled WCF web service that contains this simple method:
i have a very simple rails application that is ajax-based for some of it's
hi i created a simple php/mysql/Ajax chat application and I have a few questions.
I have a simple jquery/ajax request to the server which returns the structure and
I have a very simple ajax request: $.get(url, data) .done(function () { }) .fail(function

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.