Skip to content

Commit b6d028d

Browse files
committed
IE fix for blurring of active element
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
1 parent 67fbdce commit b6d028d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jquery.pjax.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@ function pjax(options) {
263263
}
264264

265265
// Clear out any focused controls before inserting new page contents.
266-
document.activeElement.blur()
266+
try {
267+
document.activeElement.blur()
268+
} catch (e) { }
267269

268270
if (container.title) document.title = container.title
269271
context.html(container.contents)

0 commit comments

Comments
 (0)