Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Cache references to navigator and location. Fixes #6690.
  • Loading branch information
jeresig committed Apr 16, 2011
1 parent 5b197b6 commit 94ee3e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ajax.js
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/intro.js
Expand Up @@ -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;

0 comments on commit 94ee3e9

Please sign in to comment.