From b6d028d304fbb7bcb6ab7cb4a18e9c410ac05bca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Sat, 19 Apr 2014 23:14:02 +0200 Subject: [PATCH] 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 --- jquery.pjax.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jquery.pjax.js b/jquery.pjax.js index e2f95871..7c1d3535 100644 --- a/jquery.pjax.js +++ b/jquery.pjax.js @@ -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)