button for clicking popup window?

They have: 80 posts

Joined: Feb 2003

hihi

i having a bit of probs with me button that is suppose to close the popup window.

I got this

<html>
  <body onBlur="self.close()"onLoad="self.focus()">
      <a href="javascript:self.close()">click here</a>
  </body>
</html>
'

everytime i click on the the lick to close i get the prompt box asking
"Do you want to close this window?" Mad

what can i do to stop it asking this and just close the window?

many thanks

The Webmistress's picture

She has: 5,586 posts

Joined: Feb 2001

Are you testing this from the pop-up opening from another page or just by opening that page direct? Normally the 'warning' message only comes up if the page isn't a pop-up.

Julia - if life was meant to be easy Michael Angelo would have painted the floor....

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

As Julia said, you can only control windows you generate in this fashion (i.e. by using window.open to create it). If you try to close it any other way, it will prompt the user, as it should.

nicora's picture

He has: 267 posts

Joined: Nov 2001

IE lets you cheat, you can close a window you don't have control of simply by renaming it "self" EX:

<script>

opener = self;
self.close();

</script>

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.