This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

equivalent to "window.onload"
#7
(25.06.2021, 11:48)admin Wrote: The visualization runs in a browser not in LM. The supported functions is what the browser supports.

This can be used to switch an object off when the visualization page is exited:
Code:
window.onbeforeunload = function() {
  if ($('body').hasClass('usermode')) {
    grp.write('32/2/21', false);
  }
};


Thanks!! It worsk perfectly.

I have another question, I want to know when a visualization is opened and I put this code:

Code:
  grp.write('32/1/152', true);
 
  window.onbeforeunload = function() {
    if ($('body').hasClass('usermode')) {
      grp.write('32/1/152', false);
    }
  };

But doesn´t work.

What is wrong?

Thanks!
Reply


Messages In This Thread
equivalent to "window.onload" - by SigmaTec - 06.06.2018, 07:32
RE: equivalent to "window.onload" - by admin - 06.06.2018, 07:51
RE: equivalent to "window.onload" - by admin - 25.06.2021, 11:48
RE: equivalent to "window.onload" - by DGrandes - 30.06.2021, 08:49
RE: equivalent to "window.onload" - by admin - 30.06.2021, 09:31

Forum Jump: