Google Chrome Frame jQuery *Plugin*

So, IE hacks are generally frowned upon, and blocking IE users is even worse. Sometimes the best workaround is getting your visitors to use another browser (unfortunately). Google Chrome Frame is a way to run Chrome (and all it's amazing JS/CSS stuff) inside of IE. If you haven't checked it out yet, read about CF before you go any further.
This "jQuery plugin" allows for simple implementation of the ChromeFrame plugin into your website, will auto-identify the browser and version. You specify the browser version(s) through conditional comments and the install bar at the top of the page will prompt users to install the plug-in. If the user chooses not to install the plug-in and closes it, the system will use a cookie to keep the bar from appearing in the future.
Basically I built this to be a simple, and "prettier-than-the-defaults" way of implementing CF on sites that we deem "appropriate".
Download
Click here to download the CF script. All of the instructions and code needed is in the script itself or the comment at the top. You can modify the conditional statement to apply to whichever version of IE you would like it applied to. Also, don't forget to include the jQuery core as well.
Installation
The best way to explain the installation is via the code. Basically just include a reference to the jQuery core, copy+paste the code block into your <head></head> section, and make sure the pathing is correct.
- Open the conditional comment and customize for the version(s) of IE you would like the script to effect.
- Include the META tag for Chrome Frame
- Include the CF Script (via Google) and the plugin (jquery.chrome_frame.js)
- Include the styles applied to the notification bar
- Close out the conditonal comments for IE.
That's essentially it, whatever else you do to it is up to you.
Responses to this Article:
Loading Comments...
I am a web developer, designer, and consultant located in the La Crosse / Onalaska Wisconsin region with
over twelve years experience developing and managing projects ranging from large applications and cloud-based
business solutions to social/new media campaigns, to complete system and infrastructure implementation.