Thursday, 15 April 2010

ruby on rails - Show 'upgrade your browser' modal on every page -



ruby on rails - Show 'upgrade your browser' modal on every page -

i show customized 'upgrade browser' modal dialog users if visit page on website old browser.

i know how observe browser - cannot figure out set code show modal , how it. can applicationcontroller before_filter render js calls .modal('show')? other way? pure js?

this appropriately solved using javascript.

detect browser feature need using modernizr if modernizr test fails, display popover of kind

add modernizr.js project , insert javascript application.js:

modernizr.load([ { test: modernizr.cssgradients, nope: function () { alert('sorry, browser not back upwards required feature of site. please upgrade or utilize browser.'); } } ]);

change "modernizr.cssgradients" whatever feature need.

if don't want have bare "alert", utilize noty.js, replacing alert method above with:

noty({text: 'sorry, browser not back upwards required feature of site. please upgrade or utilize browser.'});

ruby-on-rails

No comments:

Post a Comment