views:

15

answers:

0

Hi!

I've some problem with requesting an URL when finishing (exit) the widget. I try to use it via window.widget.onexit on request then an logout URL which makes some logs in the backend. I tried it by the following ways:

window.widget.onexit = function() {

 xhr = new XMLHttpRequest;
 xhr.open("GET", "http://new-ken.de/alwaysOn/php/logout.php", false );   
 xhr.send(""); 

}

AND

window.widget.onexit = function() {

  window.location.href = "http://new-ken.de/alwaysOn/php/logout.php";

}

Does somebody have an idea to solve this little problem? Thanks!