open a new window, then close the old one
how can i accomplish this
That's the default behavior of any normal HTML link.
Perhaps I'm misunderstanding your request?
i do understand that, but
my question is, the following
i want to click on a link that will open a new window (parent), and from the new window close the child window
If you want a link to open in a new window (which wouldn't be parent by the way) Then the code you need is:
But from what i understand from your post you want to open a new window and close the old one? Well that doesn't make sense because if you open a link in the normal way:
<a href="newwindow.html" target="_blank">a new window</a>
then ot will open up in the place of the window you are in, hence "closing" the page you were on, there is no function to open a link in a new window an then close the old one because i can't imagine a situation where this would be needed.
<a href="yourlink.html">Your Link</a>
Hope that helps you.
Last edited by Str8TalkingBob; 01-07-2010 at 09:52 AM.
Reason: spelling mistake
ok, let me explain better
window 1 has a link
after the link is clicked window 2 opens (_blank)
i want to close window 1 without clicking x or anything like that, but though a script.
If you want window 1 to be closed then why are you opening window 2 in a new window? it makes no sense, if you want window 1 to be closed then just open up widow 2 in its place.
i want to clear the cookie, and the only way that works is closing the browser, i tried several script to clear cookies and none of them work, so i am trying a different approach
I'm not sure that would work, given that both Fx and IE allow "new windows" to be open in "new tabs," meaning that the browser wouldn't close. Also, deletion of cookies upon close is a browser setting; the default browser behavior is to retain cookies. Only if the visitor has customized their browser preferences to eliminate cookies upon close would it work.
What I'd do is use JS to put an expiration on the cookie.
Here's a start -
Note - this still isn't foolproof.
this is one of the things i try, and i get the following error.
is not working, i get the following error
Cookies object error 'ASP 0162 : 80004005'
Cannot Modify Cookie
/forms/default.asp, line 9
The cookie 'ASPSessionID' cannot be modified. It is a reserved cookie name.
That sounds like a database problem, rather than your script.
database problem? that is the name of the cookie that gets stored on my browser, i cant modify it, that's what i understood.
But you're using ASP to connect to something, right? Or is that just the file extension you're using?
If that's not the case, I'd see if there is something running a loop with that cookie that's preventing its deletion.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)