Skip to content

Commit

Permalink
IE fix for blurring of active element
Browse files Browse the repository at this point in the history
In IE, activeElement might be null, BODY element, or SVG element. In all
such cases, `blur()` will throw an exception. This swallows the
exception and moves on.

Fixes #316 #370
  • Loading branch information
mislav committed Apr 19, 2014
1 parent 67fbdce commit b6d028d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jquery.pjax.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,9 @@ function pjax(options) {
}

// Clear out any focused controls before inserting new page contents.
document.activeElement.blur()
try {
document.activeElement.blur()
} catch (e) { }

if (container.title) document.title = container.title
context.html(container.contents)
Expand Down

0 comments on commit b6d028d

Please sign in to comment.