either using javascript, how can i ensure that the link is opened only if browser is firefox, else display an alert? i have code to check for IE but I want to ensure browser is firefox and only than allow to load link, else stay on the page where the link is.
people will normally be accessing the page with IE, but I want some links to be opened in firefox only.
pl advice.
================EDIT===============
finally i am settling down for this code:
function allow_if_ff(){
var is_ff = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; //true or false
if (!is_ff){
//window.open ("https://download.mozilla.org/?product=firefox-17.0.2esr&os=win&lang=en-US");
alert('Please open in firefox');
window.history.back();
return false;
}
}
the reason window.open is commented out is because the window is opening, but closing immediately. it is not urgent to have it. so i have commented it.
thx all.
var is_ff = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;this will work for detecting ff