Click to See Complete Forum and Search --> : Need to close a page with a link click


glenvern
07-24-2007, 07:43 AM
The old website is playing a video and I need it to self close when the <a href> link is clicked - If I could close the website/page it would solve the problem I believe. How do I do this using just the <a href> link ?

If I use target='blank' it still leaves the old website up and running even tho you can't see it you can still hear it,
if I dont use a target instruction it loads the new webpage in a frame on the old webpage.

I have tried window.close() using onUnload, onBlur, onClick in the <body> tag but none worked..

Any suggestions..?

Thanx...

Using XP & IE7

ray326
07-24-2007, 12:37 PM
Fewer and fewer browsers are letting sites close windows with Javascript.

Tweak4
07-25-2007, 02:29 PM
Yep. About the only time you can close a window with JS is if you opened it with JS. If you didn't open the window yourself, it's pretty much off limits. Otherwise you could throw a onLoad="window.close()" in your body tag and close any browser that hits your page ;)

glenvern
07-26-2007, 12:58 AM
Thanx people I got it work..