You need to sign in to do that
Don't have an account?

triggering a javascript function when closing inactive subtab
Hello
If I have multiple subtabs open and I click the "x" to close
one of the inactive subtabs, it there a way to trigger a javascript
function ?
I tried window.onunload and window.onbeforeunload, but they only seem to work
when the subtab is the active one.
Thanks.
If I have multiple subtabs open and I click the "x" to close
one of the inactive subtabs, it there a way to trigger a javascript
function ?
I tried window.onunload and window.onbeforeunload, but they only seem to work
when the subtab is the active one.
Thanks.
Please try this sample code which is used to detetct the incavtive tab:
window.addEventListener("focus", function() {
console.log("focus");
},false);
window.addEventListener("blur",function() {
console.log("blur");
},false);
You need to play around this code and get the required fuction.
Thanks
Vikash_SFDC