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 8428467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:04:00+00:00 2026-06-10T05:04:00+00:00

I have made a chat window in which user can ask for support on

  • 0

I have made a chat window in which user can ask for support on my website.
The thing is , after he’s done and wants to close the window , he presses an ‘X’ which closes the chat window.
But I did a div here which appears in the middle of the screen and asks him if he wants to really close the windows or not.
Here is the code :

<div id="background">
<div id="stay">
<p style="font-family:Tahoma, Geneva, sans-serif;font-weight:600;font-size:19px;margin-top:10px;">Exiting the support window will delete all the conversation you had with the staff and will disconnect you from the conversation. </p>
<p style="font-family:Tahoma, Geneva, sans-serif;font-weight:600;font-size:19px;">Are you sure you want to exit ?</p>
<div id="agree">
<p>Yes</p>
</div>
<div id="cancel">
<p>No</p>
</div>
</div><!--stay end-->
</div><!--background end-->

Jquery :

$("#exit").click(function() {
        $("#livesupport").hide();
        $('html, body').animate({scrollTop:0}, 'fast');
        $("#background").toggle();
        $("body").css({ 'overflow':'hidden' });
        $.post('utility/rchat.php', { table: sessid } , 
        function(getshiton) {
        });
});

“#livesupport” is the chat window.

How do I make No an answer so when the user presses it it return back to the page and no changes made to the page , and when he presses Yes he gets to have the support window closed.

  • 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-10T05:04:02+00:00Added an answer on June 10, 2026 at 5:04 am

    Instead of what you’re doing with yes and no, I would use a popup box, it’s pretty easy to do.
    Your code would look like this:

    $("#exit").click(function() {
        if(confirm("Are you sure you want to exit this window?")) {
            $("#livesupport").hide();
            $('html, body').animate({scrollTop:0}, 'fast');
            $("#background").toggle();
            $("body").css({ 'overflow':'hidden' });
            $.post('utility/rchat.php', { table: sessid } , 
            function(getshiton) {
            });
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a chat box like thing in PHP. The only problem is
I have made a simple chat application which uses long-polling approach using jquery, function
I have made a simple chat application in PHP/Ajax/MySQL. I am regularly calling these
I have made a very successful PHP chat box that saves the chat to
I am using the XMPP Connection(using smack) for chat in android application.I have made
I have made a website using( Asp.net, c# ) and its content in English
i have a java chat server & client, that works fine. I made a
I have made a chat client in linux using socket, and i wish to
I have made a simple chat script using jquery and AJAX but the huge
I have made a custom UserControl i Vb.net (windows application). How can I add

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.