Many websites display warnings about outdated browsers or even send the user to install a new browser or Google Chrome Frame.
jReject is a special jQuery plugin that allows you to display such notifications with a few lines of code.

Configuring blocked browsers
The plugin allows you to flexibly customize the list of browsers whose users will see the notification.
For example, to give a message to users of unknown browsers, as well as Firefox 2 and Internet Explorer 5, it is enough to configure the plugin as follows:
')
$ .reject ({
reject: {
msie5: true
msie6: false ,
firefox2: true
unknown: true
}
});
The fifth and sixth versions of Internet Explorer are automatically blocked by the plugin, so if you want to let IE6 users to the site without any obstacles, you must specify this separately (msie6:
false ).
The plugin allows you to specify not only certain versions of browsers, but also their entire families, engines, and operating systems. Full list of used symbols:
Group | Keywords |
---|
Opera | opera, opera7, opera8, opera9, opera10 |
Google chrome | chrome, chrome1, chrome2, chrome3, chrome4 |
Firefox | firefox, firefox1, firefox2, firefox3 |
Internet Explorer | msie, msie5, msie6, msie7, msie8 |
Safari | safari, safari2, safari3, safari4 |
Konqueror | konqueror, konqueror1, konqueror2, konqueror3 |
Engines | gecko, webkit, trident, khtml, presto |
OS | win, mac, linux, solaris, iphone |
All the rest | unknown |
Browsers Offered
A list of modern browsers that are offered for installation can be easily configured manually. For example, the following code can be used to display an offer for IE users to install Google Chrome Frame:
$ .reject ({
reject: {msie: true , firefox1: true },
browserInfo: {
gcf: {
text: 'Google Chrome Frame' ,
url: 'http://google.com/chromeframe' ,
allow: {all: false , msie: true }
// Forbid to show Google Chrome Frame button for all browsers except IE
}
}
});
Useful options
The plugin supports a number of options, the meaning of which is quite clear from their names.
- In order to completely restrict access to the site to users of outdated browsers, you can set the close parameter to false - in this case, the user will not be able to close the notification window and will have to refresh the browser or get away from the site.
- To manually specify the texts that will be displayed by the plugin, you can use the following parameters: header , paragraph1 , paragraph2 , closeMessage , closeLink .
- You can also configure the background dimming options — the plugin supports overlayBgColor, overlayOpacity, fadeInTime, and fadeOutTime.
Features
Right in the plugin itself, the standard set of browsers offered is included, along with their versions that have long been outdated. Despite the fact that the plugin was updated less than a month ago, it still offers to install Chrome 18 or Opera 11 by default. In order to correct this misunderstanding, you just need to specify the current versions in the plugin code itself, or remove the version altogether, leaving only browser names. The second option, of course, will be much more correct - hardly anyone will constantly update the data with the release of new versions of browsers. You can also manually specify a list of browsers with their current versions when calling the plugin.
Another important point: in order to correctly display the logos of browsers, you must specify the address of the directory where they are located in the
imagePath parameter. The default path is
./images/ .
Links
Download jReject and get acquainted with more detailed examples of its use on the
site of the plugin.