Cache references to navigator and location. Fixes #6690.

This commit is contained in:
John Resig 2011-04-16 14:18:56 -07:00
parent 5b197b6c5f
commit 94ee3e9743
2 changed files with 5 additions and 3 deletions

View File

@ -45,9 +45,9 @@ var r20 = /%20/g,
ajaxLocParts;
// #8138, IE may throw an exception when accessing
// a field from document.location if document.domain has been set
// a field from window.location if document.domain has been set
try {
ajaxLocation = document.location.href;
ajaxLocation = location.href;
} catch( e ) {
// Use the href attribute of an A element
// since IE will modify it given document.location

View File

@ -16,4 +16,6 @@
(function( window, undefined ) {
// Use the correct document accordingly with window argument (sandbox)
var document = window.document;
var document = window.document,
navigator = window.navigator,
location = window.location;