0

I am facing a problem i need to hit the webservice before closing the tab. i am using this

 <script>
function myFunction() {
    return "Write something clever here...";
}
</script>   

 <body  onbeforeunload="return myFunction()">

i don't know where i hit the webservice while closing the tab its show the prompt where show stay on page and leave the page. So i implemented the condition if leave then hit the webservice otherwise its remain same

Sumit Aggarwal
  • 831
  • 2
  • 16
  • 29
  • 1
    See this http://stackoverflow.com/questions/9701734/how-to-execute-ajax-function-onbeforeunload – RamblinRose May 24 '16 at 11:05
  • i could not understand i need to hit the webservice should i use javascript or jquery – Sumit Aggarwal May 24 '16 at 11:35
  • – Sumit Aggarwal May 24 '16 at 12:25
  • i am using above but its trigger also while i refersh the page – Sumit Aggarwal May 24 '16 at 12:26

0 Answers0