Skip to content

Commit f84f359

Browse files
committed
Merge pull request jquery-archive#2154 from SamuelKC/bug_2064
Fix for issue jquery-archive#2064
2 parents 2c46151 + 051855e commit f84f359

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

js/jquery.mobile.navigation.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,11 @@
874874
// XXX_jblas: We need to stop crawling the entire document to kill focus. Instead,
875875
// we should be tracking focus with a live() handler so we already have
876876
// 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) {}
878882

879883
// If we're displaying the page as a dialog, we don't want the url
880884
// for the dialog content to be used in the hash. Instead, we want

0 commit comments

Comments
 (0)