I just got a great tip from Michael Washington (yes, that awesome dude from that awesome website) that I wanted to post while I’m working on a large blog post about threading in LightSwitch (whoops),
If an end-user tries to open a LightSwitch application in a browser that is not supported, they are very likely to get stuck on the loading screen, with a little loading animation leading them to believe that the application is almost ready to rock&roll. Unfortunately, a lot of browsers will silently swallow the JavaScript exceptions (or just show a minor warning icon with a message that makes no sense to end users anyways, at best), making the user wait in vain until the loading icon stops spinning.
One way to reduce the number of support tickets heading towards the internal IT department, is to prepend the loading of the LightSwitch JavaScript libraries with a check if JQuery mobile is supported.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$(document).ready(function () { | |
var supported = $.mobile.gradeA(); | |
if (!supported) { | |
$(".ui-icon-loading").hide(); | |
$(".ui-bottom-load").append('<div class="msls-header">This browser is not supported. Please upgrade to a more recent, <a href="http://jquerymobile.com/gbs/">supported</a> version.</div>'); | |
} else { | |
msls._run() | |
.then(null, function failure(error) { | |
alert(error); | |
}); | |
} | |
}); | |
</script> |
Small caveat: not all browsers that support JQuery mobile at A-grade, will be able to run LightSwitch HTML apps. My WP7.8 for example is not running LightSwitch HTML apps correctly, although it will slip through the net of this check. This means you can either deal with that small percentage by buying enough hardware to run every possible browser and manually cross-check every LightSwitch feature so that you can keep a completely bullet-proof browsers<>version matrix up to date, or keeping this maintenance-free check and letting the IT crowd handle the rest… (thanks Matthieu for getting me addicted :p)
Keep rocking LS!
Pingback: Beth Massi - Sharing the goodness
Awesome post.
Thanks!