Time is running …
Hello!
Today you can download my new version from “jQuery badBrowser Script” . Why and how it works you can read in my last articles:
- fight-old-browsers-warning-with-jquery
- release-bad-browser-new-version-13
- fight-internet-explorer-6-reloaded
After several comments to the missing MSIE 5.5 detecting i decided to update my script and tell you my solution:
I have tested several ways to use JavaCcript/jQuery and useragent identification.
// special Testcheck for dirty Microsoft Internet Explorer 5.5
if (userAgent.indexOf("MSIE 5.")>=0) {
return true;
}
Nothing happens. Mostly the Browser doesn’t work with JavaScript or displays many errors.
MSIE 5.5 is very old and in my opinion it’s enough to detect IE 6.0. In special cases you may use conditional comments like this:
<head>
<!--[if lte IE 5]>
<style> body {background:yellow;}</style>
<![endif]-->
</head>
The actually jQuery library is 1.4.2, since version 1.3 the jquery.browser command is deprecated, but on the website you can read:
The
$.browserproperty is deprecated in jQuery 1.3, but there are no immediate plans to remove it.
My small Changelog:
- update the browser version support, alert if smaller then:
- Firefox < 3 .0
- Opera < 9.5
- Safari < 4.0
- Google Chrome < 3.0
- MSIE < 8.0
- Firefox < 3 .0
- German warning language
Please comment this Post for hints, tricks and more … have fun!
badBrowser Version 1.4 ( 1107x )
UPDATE 19.05.2010: Now you can also find a minimized .js Version in the download-zip (Thanks to fleshgrinder). Nice javascript compression tool.
Related posts:
I found another solution before http://browser-update.org, but this is better and feel tiny file size.
may be can combine the getbrowser script to be more powerful to modify browser version.
whatever thanks so much for this pretty code.
Thanks Alan!
You are right, the browser-update.org is really comfortable!
Maybe i “copy” this “click and go” event, but actually there is no time …
Greetz! Martin
Is there a link to an English version? The link takes me to the _de version.
Hi Josh,
actually the version 1.4 is only in german. But the language-part is less then 100 characters … hopefully i will do this after holiday … or you can do it?!
Hi,
i guess i found a bug with close button and cookie set. It does not work and the message always show. So i added days number to the function on the end of the code and it works now:
setBadBrowser(‘browserWarning’,'seen’,7);
Am i right:)
PS: Nice work!
The latest version of Chrome is 10, this script just takes a single char from the string so fails after version 9. Replace this:
var snip1 = chrome+7;
var version = userAgent.substring(snip1, (snip1+1));
With this:
var snip1 = chrome+7;
snip2 = userAgent.indexOf(“.”,snip1);
var version = userAgent.substring(snip1, snip2);
Andy
@Andy thank you so much for that patch! Noticed this today after updating Chrome to v10, and was happy to find your fix so fast. Cheers to you and blumentritt for the original script!
Hi,
thank you @all for feedback and patches. currently i have no time to patch my (old) script – please be patient. i have several updates (in my mind) and hope to find some hours to update the badBrowser Script (-> version 2.0!!!)
keep on posting.
martin
Googlebot (which generates the preview images of webpages) is also recognized as a bad browser. The preview images all contain the bad browser warning.
Example (first search result):
http://www.google.de/search?q=eventpeppers
Are there any plans for fixing this?
@Andi
after changing:
var snip1 = chrome+7;
var version = userAgent.substring(snip1, (snip1+1));
with:
var snip1 = chrome+7;
snip2 = userAgent.indexOf(“.”,snip1);
var version = userAgent.substring(snip1, snip2);
the script works just for ie7. in ie6 nothing happends. why?
btw: 10x for the script