hello i have a Django base app and one of its apps is chatting with customer service.
i want when the customer clicks on the the [x] icon or close the window, a small popup window should come up that include:
1.a string like "thank you, and we hope you can take time and answer the survey:" 2. a button that directs the customer to the survey page.
i have this part of the chatting app java script file:
    window.onbeforeunload = function() {
       window.open ("http://gadgetron.store/male_chatbot/popup/"); <= i have tried it and it doesn't work
       $.ajax({
          type: 'GET',
          url: 'http://gadgetron.store/chatbot/run_python_clear_chatM/',});} 
thank you,
 
     
    