Skip to content
This repository
Browse code

Bug 2064; Add try/catch block to prevent 'Unspecified error' when we …

…use an IFrame on IE9
  • Loading branch information...
commit 051855e94d740e52848867640285e7f3758d6e8e 1 parent 705ed4f
SamuelKC SamuelKC authored

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. +5 1 js/jquery.mobile.navigation.js
6 js/jquery.mobile.navigation.js
@@ -874,7 +874,11 @@
874 874 // XXX_jblas: We need to stop crawling the entire document to kill focus. Instead,
875 875 // we should be tracking focus with a live() handler so we already have
876 876 // the element in hand at this point.
877   - $( document.activeElement || "" ).add( "input:focus, textarea:focus, select:focus" ).blur();
  877 + // Wrap this in a try/catch block since IE9 throw "Unspecified error" if document.activeElement
  878 + // is undefined when we are in an IFrame.
  879 + try {
  880 + $( document.activeElement || "" ).add( "input:focus, textarea:focus, select:focus" ).blur();
  881 + } catch(e) {}
878 882
879 883 // If we're displaying the page as a dialog, we don't want the url
880 884 // for the dialog content to be used in the hash. Instead, we want

0 comments on commit 051855e

Please sign in to comment.
Something went wrong with that request. Please try again.