I want to test if the user is using Firefox under version 3.0, if yes trigger the function and here’s what I ended up with! Now I use the version 14.0 of Firefox to test it out and it still trigger the function! Anyone can help a beginner? Thanks!
script:
if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ //test for Firefox/x.x or Firefox x.x (ignoring remaining digits);
var ffversion= Number(RegExp.$1) // capture x.x portion and store as a number
if (ffversion<=3)
{
You could just do it in one regex test: