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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:10:39+00:00 2026-05-25T02:10:39+00:00

In my web application, the user can open a popup window to select an

  • 0

In my web application, the user can open a popup window to select an edit an object. When the user presses OK on the popup, it’s supposed to update the src of an iframe in the parent window (and of course reload the iframe) according to which object was selected.

My function (in the parent window) is:

function dismissEditPopup(win, newId) {
    newId = html_unescape(newId);
    var elem_iframe = document.getElementById("iframe_id");

    // (*) this line doesn't work
    elem_iframe.src = '/view_object/' + newId;

    elem_iframe.contentWindow.location.reload();

    win.close();
}

This function is called from a popup window, which contains a script:

<script type="text/javascript">
    opener.dismissEditPopup(window, "hash_of_new_object");
</script>

The problem is that the line (*) fails silently. In the inspector in both Firefox 3.6 and Google Chromium, I see that the src attribute of the iframe is being updated, but elem_iframe.contentWindow.location.href is unchanged. (If I add a line elem_iframe.contentWindow.location.href = elem_iframe.src;, the assignment is ignored.). There are no errors in the Javascript error console. Strangely, it does work as expected if I assign to elem_iframe.src from the Javascript console.

I am able to change the value of a hidden <input> field in the same way, using document.getElementById("hidden_id").value = newId;.

Everything is served from the same website.

(Similar to Changing iframe src with Javascript, but the answers to that question don’t work, presumably because the code is called from a popup.)

  • 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-25T02:10:39+00:00Added an answer on May 25, 2026 at 2:10 am

    Take this line out:

    elem_iframe.contentWindow.location.reload();
    

    It’s reloading the iframe and the new src is not loaded.

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

Sidebar

Related Questions

Currently I have a web application where a user can use dropdown lists to
Can you use FluentHTML or other alternatives in an web application user control? Can
I have a web application with users and their documents. Each user can have
In a web application I am working on, the user can click on a
I have build a web application which the user can request a report which
I am trying to open a popup window to allow a user to authenticate
The users of my web application may have more than one browser window open
For part of a web application the user needs to import some data from
We have an existing publicly accessible web application with user controls, data access libraries,
I have a situation where in a web application a user may need a

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.