Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: Close Browser Script

  1. #1
    Join Date
    Aug 2006
    Posts
    58
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Default Close Browser Script

    hi guys. i just wanted to ask you of some script that Close the browser when someone click a link. i didnt see any scripts like this in www.dynamicdrive.com scripts.

    example :

    when someone click a link named 'exit' in a webpage. the browser automatically closed.


    can you give me the script ? i have been looking for a while now. but i cant find it.

  2. #2
    Join Date
    Nov 2005
    Posts
    132
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    this should do the job.

    javascript:self.close()

  3. #3
    Join Date
    Aug 2006
    Posts
    58
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Default

    well, should i put it in <script> tag. or where should i put it ?

    i want when an image saying Exit is clicked the browser closed without any warning

  4. #4
    Join Date
    Nov 2005
    Posts
    132
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    <a href="#" onClick="MM_callJS('javascript:self.close()')">close browser </a>

  5. #5
    Join Date
    Aug 2006
    Posts
    58
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Default

    does it work with <img src=#> tag ?

  6. #6
    Join Date
    Nov 2005
    Posts
    132
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    <a href="#" onClick="MM_callJS('javascript:self.close()')"><img src="your_image_here.gif" alt="image" width="10" height="10" /></a>

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by k12onos
    i want when an image saying Exit is clicked the browser closed without any warning
    No warning, huh? I'd say that the image with the word Exit on it would be a dead giveaway.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    Aug 2006
    Posts
    58
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Default

    what do you mean it would be a dead giveaway ?

    you mean its useless because nobody would click it ?

    oh dont worry i know somebody will click it

    <a href="#" onClick="MM_callJS('javascript:self.close()')"><img src="your_image_here.gif" alt="image" width="10" height="10" /></a>

    does this give warnings when we click the image ?
    aanyway testing it now

  9. #9
    Join Date
    Nov 2005
    Posts
    132
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    The text or image you use to close the window would act as the warning as I assume you'd flag the resultant outcome of clicking the link with text stating " close this window" or something similar.

  10. #10
    Join Date
    Aug 2006
    Posts
    58
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Default

    <a href="#" onClick="MM_callJS('javascript:self.close()')"><img src="your_image_here.gif" alt="image" width="10" height="10" /></a>


    this one didnt work on either IE or firefox.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •