Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

top.close() not working

Status
Not open for further replies.

emozley

Technical User
Joined
Jan 14, 2003
Messages
769
Location
GB
I have a a page in a frame called meetingheader.asp which redirects to another page using the following when someone clicks on a link:

<script>
function acceptbooking()
{
location = 'mail/acceptandnotify.asp?MeetingID=<% = MeetingID %>'
}
</script>

Then in my acceptandnotify.asp page the plan is to update the main window behind the popup then close the popup with the following:

<script>
top.opener.location.reload(true);
top.close();
</script>

The main window refreshes but instead of closing the popup it goes back to the first page meetingheader.asp.

Any ideas please?

Thanks very much
 
Yep same result...
 
I suggest you drop the whole idea of using a popup completely. Use AJAX techniques to do this. You will be able to duplicate a POST or a GET form submit with ease... and the whole line count should sit at less than 20 lines.

That way you have no problems with popup blockers and the like.

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Having looked at it all week I finally figured out what the problem was. Basically the app sends someone an email saying 'a meeting has been booked for you click here to view it'. This link would load the main window but there would be a parameter in the link which would cause the popup to appear with the meeting details. Rather stupidly I failed to realise that by refreshing the main window this would of course cause the popup to re-appear when it was closed.

I've not come across AJAX before but will be looking into this. Fortunately the app is run across a corporate intranet and none of our users have popup blockers but certainly it is something I will have to consider at some point.

cheers and thanks very much!
 
...Fortunately the app is run across a corporate intranet and none of our users have popup blockers...
I was stunned to wander around one of my client sites and see just how many users had the Google Bar or the Yahoo Bar installed (both act as popup blockers). The users didn't even know what it was!

Anyway, check out AJAX as a possible replacement should you ever end up with popup blocker issues [smile]

Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
I personally stopped using popup windows even for our corporate intranet. It is easier to bring the data up in an absolutely positioned box on the same window. You can place it right on top of anything else in the window and you do not have to worry about relaying values between the two windows or have problems dealing with the closing or focusing of them.


Stamp out, eliminate and abolish redundancy!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top