Closing a web page

G

Guest

I am using the following code to open another .aspx page

function viewCart() {
window.open('ShoppingCart.aspx')
}

The above function is attacked to the onClick event of a button.

However, when I use following code attached to a button on the newly opened
page, it just reposts. Basically the page should be closing itself.

function CloseCart() {
self.close;
}

All suggestions from previous posts that I could find have not worked.
Anyone know how to really do this?

WR
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

Although the self reference is not in the standard, most browsers
support it for historical reasons. It's better to use the windows
reference, though.

What makes the magical difference here is the parantheses. Nicely
spotted, I missed that one. :) Without them, you just get a reference to
the close method and throw it away.
 
G

Guest

I take it back. Window.Close() does not work but window.close does.
Now my next question is how to get the calling page to refresh if a changes
was made on the called page?

wr
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top