I need to logout an user if he/she tries to submit any valid URL from the address bar?
I tried jQuery on items below but it is not working.
window.location.href
window.unload
unload code
(window).unload(
function(event) {
//code to handle
});
location href code
(function() //create a scope so 'location' is not global
{ var location = window.location.href;
setInterval(function()
{
if(location != window.location.href)
{
location = window.location.href;
window.location.changed(location);
}
}, 1000);
}
)();
window.location.changed = function(e)
{ console.log(e);//outputs http://newhref.com
//this is fired when the window changes location
}