cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
432
Views
0
Helpful
1
Replies

finesse unload event

chapelain36
Level 1
Level 1

Hi, all.

I am working with finesse in the sandbox lab.

How can I catch the window.unload event?
I have the following code in gadget init function.

$(window).on('unload', function() {

var x ="unload";

return x;

});

This code works on any other webpage. Similar code works for "beforeunload" event in finesse.
But finesse ignores it, when I am closing the page, even if I am setting the breakpoint in this function.

What am I doing wrong? Maybe I missed something?

Thank you.

With regards, Yuriy.

t

1 Accepted Solution

Accepted Solutions

dekwan
Cisco Employee
Cisco Employee

Hi,

Take a look at the jquery documentation about unload: https://api.jquery.com/unload/

According to that documentation,

The exact handling of the unload event has varied from version to version of browsers. For example, some versions of Firefox trigger the event when a link is followed, but not when the window is closed.

I put the code you pasted above into the gadget's init (SampleGadget*.js). When I added a link to the gadget (make sure the link is https to avoid the mixed-mode browser error) and followed it, the unload is triggered. If I closed the window, it didn't trigger the unload.

Thanx,

Denise

View solution in original post

1 Reply 1

dekwan
Cisco Employee
Cisco Employee

Hi,

Take a look at the jquery documentation about unload: https://api.jquery.com/unload/

According to that documentation,

The exact handling of the unload event has varied from version to version of browsers. For example, some versions of Firefox trigger the event when a link is followed, but not when the window is closed.

I put the code you pasted above into the gadget's init (SampleGadget*.js). When I added a link to the gadget (make sure the link is https to avoid the mixed-mode browser error) and followed it, the unload is triggered. If I closed the window, it didn't trigger the unload.

Thanx,

Denise