Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@janvanderhaegen
Created July 18, 2013 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janvanderhaegen/6033407 to your computer and use it in GitHub Desktop.
Save janvanderhaegen/6033407 to your computer and use it in GitHub Desktop.
Adds a check to see if JQuery mobile is supported, to the LightSwitch loading screen (default.html). This will catch most of the browsers that are unable to run LightSwich HTML apps (see note on http://janvanderhaegen.wordpress.com/2013/07/19/detect-if-the-browser-will-run-your-lightswitch-html-app/)
<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment