ja sam kod izmenio i prilagodio ga prema tipu browsera
Code:function ClearAuthentication(LogOffPage)
{
var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
var agt=window.navigator.userAgent;
var IsInternetExplorer10 = agt.indexOf('MSIE');
var IsInternetExplorer11 = agt.indexOf('Trident');
var IsEdge = agt.indexOf('Edge');
var IsFirefox = agt.indexOf('Firefox') > -1;
if (IsInternetExplorer10>0 || IsInternetExplorer11>0 || IsEdge>0)
{
$.ajax({
username: 'unknown',
password: 'WrongPassword',
url: './cgi-bin/PrimoCgi',
type: 'GET',
beforeSend: function(xhr)
{
xhr.setRequestHeader("Authorization", "Basic dW5rbm93bjpXcm9uZ1Bhc3N3b3Jk");
},
error: function(err)
{
window.location = 'LogOffPage';
}
});
}
else if(isChrome || IsFirefox)
{
$.ajax({
username: 'unknown',
password: 'WrongPassword',
url: './cgi-bin/PrimoCgi',
type: 'GET',
beforeSend: function(xhr)
{
xhr.setRequestHeader("Authorization", "Basic dW5rbm93bjpXcm9uZ1Bhc3N3b3Jk");
},
error: function(err)
{
window.location = 'http://logout:
[email protected]';
}
});
}
}
Medjutim linija za chrome i firefox ne radi uvek
moze li mi neko dati neku instrukciju?