Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8585185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:59:48+00:00 2026-06-11T21:59:48+00:00

I am wondering if I can have the unload method in Javascript do a

  • 0

I am wondering if I can have the unload method in Javascript do a button.click; or a document.getElementById('target').click(), now I am working on different methods for different browsers but I can’t seem to get them it working together.

The reason for this is I want to clear the information in the browser but I can’t seem to get the unload method to work right. But I don’t even know if the unload method is capable of doing a button.click or a document.getElementById('target').click(); Is there like a list of things this method can or cannot do? Here is the code I am trying to get working:

  window.onunload=leave;

     function leave() {
        
    // For Internet Explorer only. 
    if (navigator.appName == "Explorer"){
    document.getElementById('kioskform:broswerCloseSubmit').click();
    }
    
    // For Chrome only
    if (navigator.appName == "Chrome"){
    // add code for Chrome to use.
    }
    
    // for Safari only
    if (navigator.appName == "Safari"){
    // add code for Safari to use
    }
    
    // for Firefox only 
    if (navigator.appName == "Firefox"){
    // add code for Firefox to use
    }
    
}

So far the only thing working is IE but the other web browsers are not liking the code in the document. But I want to try other methods for the other browsers I am working with. But I can’t seem to get browser detection to work at all, any idea’s or suggestions or advice is greatly appreciated thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:59:49+00:00Added an answer on June 11, 2026 at 9:59 pm

    Some browsers (Chrome / FF) does not support the window.onunload method.

    See: http://bugs.jquery.com/ticket/10509

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code which is working, I was wondering if this can
I'm new to JQuery and was wondering how can I have Changes saved! displayed
I'm kind of new to JQuery and was wondering how can I have the
I was wondering how can convert CGcolorRef to UIColor ? I have created a
Just wondering how I can paste an object after I have selected it in
I am wondering how i can find all rows that have the same ID
I was wondering if anyone can point me in the right direction. I have
I have a UIImageview in my application and I was wondering how I can
I was wondering if someone can help me out with this issue. I have
I have an array of values, I was wondering how I can parse certain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.