Ravi Gadag
Ravi Gadag

Reputation: 15861

onunload event in chrome or is there any alternative work arounds

as i searched quite for this issue, including google chrome support sites, Chrome Bug Issues, as they are not yet fixed the problem. Right now i have a situation where i should use onuload or onbeforeunload event in my JS Snippets, as its working nicely in other browsers. these are the things which i've tried of now

Is there any work around for this weird problem, i hope anyone already experienced the same problem, and they may got some alternative.

<html>
<script type="text/javascript" >
function DoSomethingonUnload()
{
alert ('im unloading');

}
</script>
<body onunload="DoSomethingonUnload();"> //need alternative which can work in (ie,chrome,ff)
</body>
</html>

Upvotes: 2

Views: 7236

Answers (1)

Ravi Gadag
Ravi Gadag

Reputation: 15861

Using jQuery, I achieved this task. Using Bind function with onbeforeunload event jQuery bind . it works seamlessly :) :) thank you @ Sergey Ratnikov

Upvotes: 1

Related Questions