Link to home
Start Free TrialLog in
Avatar of ap_sajith
ap_sajith

asked on

window.opener issue

Hi all,
I have this problem..

I have this page (home.asp) which opens up a popup, which has clickable links... on clicking the link, i am minimizing the popup and calling a function in the opener window ie, home.asp. The function in the homepage redirects the page to view.asp to view the details. Now the problem starts... i go back to the popup and click the next link... this does no action as the window.opener has changed its location. I even tried adding the function in the home page in view.asp.. but still dosnt pick it...

Any ideas as to how to go about this..

Do let me know if you need any further details..

Thanks to all in advance :o)
Cheers!!
Avatar of Nushi
Nushi

you can simply redirect the home pag eto the location which opened this pop up.

does it helping you.?
Avatar of ap_sajith

ASKER

I open the popup from the home page... and then on clicking the link in the pop up, the parent window (currently displaying home.asp) has to be redirected to view.asp. Now i go back to the popup (the parent window currently displays view.asp or any of the other pages the user has navigated to!!) and click on the link again.. now the script in the popup does not recognise the window.opener argument anymore...

Cheers!!
SOLUTION
Avatar of James Rodgers
James Rodgers
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
typo - forgot to close the onclick

<a href="#" onClick="redirectParent('http://www.google.com/'); return false">Google</a>
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@Jester.. That wouldnt work.. anyway.. i cant use absolute URLS as well..

@VincentPuglia, I cant use popups or frames...I tried using the function in the popup itself.. however, the same problem with the window not recognising the parent window arose...

Any other ideas?
Cheers!!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi ap_sajith


  Ok, you can't use popups & frames.  & you 'must' redirect the opener.   & you must access view.asp through the popup  (not leaving yourself many choices, huh? :)

Flynnious may have something there:

Try this in the popup :

var viewPage = opener;
viewPage.location = "view.asp"

then in the popup have the functions and try accessing the view.asp with:
alert(viewPage.document.forms[0].name)

Vinny
I'll give these a shot... In the meantime.. if anyone else has anyother ideas, then please post your ideas...

Cheers!!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for you input guys.. I think i have solved the problem..

I moved the function used to navigate to the new page from the home page to the topbar include file so that all the pages will heve that function...

<FORM NAME="frmNavigate" METHOD="POST">
<INPUT TYPE="Hidden" NAME="EventID">
</FORM>

<script>
function Navigate(EventID)
      {
      document.frmNavigate.action="viewEvent.asp"
      document.frmNavigate.EventID.value=EventID;
      document.frmNavigate.submit();
      }
</script>

And in the Popup page, i am using..

<script>
function viewEvent(EventID)
{
      window.self.blur();
      window.opener.focus();
      window.opener.Navigate(EventID);

}
</script>

That did the trick... Thanks to all of you who has come up valuable suggestions.. I guess i would split up the points among you guys...

Cheers!!
I am using the form post method rather than the window.navigate method as the popup window is called from a different subfolder and i cannote pass the absolute url. If i used window.navigate, then the url is appended with the pop ups' folder path.. thereby generating a 404 error.

Cheers!!
thanks, glad you found my input useful
Thamks for the points.
you guys deserve it.. thanks a lot..

Cheers!!