onexit - request an url

594 views Asked by At

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!

1

There are 1 answers

0
msibai On

Try to use this code:

widget.openURL("http://new-ken.de/alwaysOn/php/logout.php");