Code Monkey home page Code Monkey logo

outdated-browser's Introduction

Outdated Browser v1.0

A time saving tool for developers. It detects outdated browsers and advises users to upgrade to a new version.

So, you're tired of people visiting your modern website with an outdated browser and not doing anything about it. Maybe they aren't "power" users, maybe it's your auntie running a last century browser trying to see awesome CSS3 animations and transforms. Let the user know that’s an outdated browser, and advise them on a better one.

With this solution you can check if the user’s browser can handle your website. If not, it will show a cool looking notice advising the user to update the browser. It'll be up to him/her to decide if he upgrades or not. Don't force the user!

That's it! As simple as it can get.

How to use it

  1. Include plugin's script:

    <script src="outdatedBrowser.min.js"></script>
  2. Include the CSS located in the html head:

    <style type="text/css" src="outdatedBrowser.min.css"></style>
  3. Paste the required HTML:

     <div id="outdated">
         <h6>Your browser is out-of-date!</h6>
          <p>Update your browser to view this website correctly. <a id="btnUpdate" href="http://outdatedbrowser.com/">Update my browser now</a></p>
          <p id="btnClose"><a href="#">Close</a></p>
      </div>
    
  4. Call the plugin:

      //PLAIN JAVASCRIPT
         //event listener form DOM ready
         function addLoadEvent(func) {
             var oldonload = window.onload;
             if (typeof window.onload != 'function') {
                 window.onload = func;
             } else {
                 window.onload = function() {
                     oldonload();
                     func();
                 }
             }
         }
         //call plugin function after DOM ready
         addLoadEvent(
             outdatedBrowser({
                 bgColor: '#3f3f3f',
                 color: '#e3e3e3',
                 lowerThan: 'IE10'
             })
         );
    
       //USING jQuery
         $( document ).ready(function() {
             outdatedBrowser({
                 bgColor: '#3f3f3f',
                 color: '#e3e3e3',
                 lowerThan: 'IE10'
             })
         })
    
  5. Targeting browsers:

    You can do it in one of two ways: using Internet Explorer browsers as reference or specifying a CSS property. The outcome is the same, choose what is easier for you.

    Lower Than:

    • "IE11","borderImage"
    • "IE10", "transform" (Default property)
    • "IE9", "boxShadow"
    • "IE8", "borderSpacing"

And you're done!


Team

Made with love at Bürocratik.

Contributing

Fork the project.
Read through the outstanding issues or report new ones.
Write some tests to make sure we don't accidentally break each other's code.
Send a pull request.

License

MIT License

outdated-browser's People

Contributors

alexprg avatar anacamacho avatar brunoamorim avatar zone-live avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.