|
81 | 81 | (function($,window,undefined){ |
82 | 82 | '$:nomunge'; // Used by YUI compressor. |
83 | 83 |
|
84 | | - // Method / object references. |
85 | | - var fake_onhashchange, |
86 | | - jq_event_special = $.event.special, |
| 84 | + // Reused string. |
| 85 | + var str_hashchange = 'hashchange', |
87 | 86 |
|
88 | | - // Reused strings. |
89 | | - str_location = 'location', |
90 | | - str_hashchange = 'hashchange', |
91 | | - str_href = 'href', |
| 87 | + // Method / object references. |
| 88 | + fake_onhashchange, |
| 89 | + jq_event_special = $.event.special, |
92 | 90 |
|
93 | 91 | // IE6/7 specifically need some special love when it comes to back-button |
94 | 92 | // support, so let's do a little browser sniffing.. |
|
102 | 100 | // Get location.hash (or what you'd expect location.hash to be) sans any |
103 | 101 | // leading #. Thanks for making this necessary, Firefox! |
104 | 102 | function get_fragment( url ) { |
105 | | - url = url || window[ str_location ][ str_href ]; |
| 103 | + url = url || location.href; |
106 | 104 | return '#' + url.replace( /^[^#]*#?(.*)$/, '$1' ); |
107 | 105 | }; |
108 | 106 |
|
|
227 | 225 | $(window).trigger( str_hashchange ); |
228 | 226 |
|
229 | 227 | } else if ( history_hash !== last_hash ) { |
230 | | - window[ str_location ][ str_href ] = window[ str_location ][ str_href ].replace( /#.*/, '' ) + history_hash; |
| 228 | + location.href = location.href.replace( /#.*/, '' ) + history_hash; |
231 | 229 | } |
232 | 230 |
|
233 | 231 | timeout_id = setTimeout( poll, $[ str_hashchange + 'Delay' ] ); |
|
274 | 272 |
|
275 | 273 | // Get history by looking at the hidden Iframe's location.hash. |
276 | 274 | history_get = function() { |
277 | | - return get_fragment( iframe[ str_location ][ str_href ] ); |
| 275 | + return get_fragment( iframe.location.href ); |
278 | 276 | }; |
279 | 277 |
|
280 | 278 | // Set a new history item by opening and then closing the Iframe |
|
288 | 286 | domain && doc.write( '<script>document.domain="' + domain + '"</script>' ); |
289 | 287 | doc.close(); |
290 | 288 |
|
291 | | - iframe[ str_location ].hash = hash; |
| 289 | + iframe.location.hash = hash; |
292 | 290 | } |
293 | 291 | }; |
294 | 292 |
|
|
0 commit comments