parm530
12/26/2019 - 2:07 PM

Outdated Browser Notification

Set up Outdate Browser Notification

  • Place files(min.css and min.js) within the vendor/assets/ configuration
  • Add the file names (including .min) to the list of assets in assets.rb
  • Add the file names (including .min) to the application.js and application.css manifest files
  • Add the following js to the bottom of the body:
<% if request.env['HTTP_USER_AGENT'] && request.env['HTTP_USER_AGENT'].match(/MSIE/) %>
<div id="outdated">
    <h6>Your browser is out-of-date!</h6>
    <p>Please update your browser to view this website correctly. <a id="btnUpdateBrowser" href="http://outdatedbrowser.com/">Update my browser now </a></p>
    <p class="last"><a href="#" id="btnCloseUpdateBrowser" title="Close">&times;</a></p>
</div>

  <script>
      $(document).ready(function() {
          outdatedBrowser({
              bgColor: '#f25648',
              color: '#ffffff',
              lowerThan: 'borderImage',
              languagePath: ''
          })
      })
  </script>
<% end %>
  • Reload and check the browser version!