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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:54:21+00:00 2026-05-10T17:54:21+00:00

This is kind of a weird problem, but I have to create a search

  • 0

This is kind of a weird problem, but I have to create a search box for our site that will be iframed on another site. When the user clicks the search button, it needs to redirect the parent frame to our search results page.

At the moment what I’ve done is to make the search button a postback trigger then registering a client script block to run this:

if (window.parent) window.parent.location.href='<url>'; 

This is ok, but it seems like a hack & it means if the user clicks back on the browser after searching, it redirects them back to the search results page.

Is there a better way of doing 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. 2026-05-10T17:54:21+00:00Added an answer on May 10, 2026 at 5:54 pm

    OK, since noone else has answered, I’ll give this a go.

    First off, are you testing the code you’re using in a real-world way? I am concerned that in a real-world application that your iframed page and the parent page will not reside on the same domain. If so, there is not likely to be any way for your code to direct the parent window to any URL.

    If you are allowed to control the parent frame’s location, your code looks fine to me. If you don’t want the new URL in the history, I believe that you can use:

    if (window.parent) { window.parent.location.replace('<url>'); }

    See for example: ‘The Difference Between Javascript Redirect Methods’

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

Sidebar

Related Questions

This might sound kind of weird, but I have a query that joins two
I have this weird problem that's killing us. I have a widely used app
I have kind of a weird problem .. Something that isn't working on ff
This is kind of weird problem. I have been using HttpWebRequest for a long
I got a weird problem. I have a program that (does many things but
We're trying to create a .NET aspx page that will have a PDF within
This is a weird situation and I normally would never do it but our
Really weird problem. I have a tableView that pulls data out of a Core
This is kind of a weird question so my title is just as weird.
This kind of code would normally work in PHP, but since the scope is

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.