mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-17 15:11:04 +00:00
34 lines
863 B
JavaScript
34 lines
863 B
JavaScript
/*!
|
|
{
|
|
"name": "Hashchange event",
|
|
"property": "hashchange",
|
|
"caniuse": "hashchange",
|
|
"tags": ["history"],
|
|
"notes": [{
|
|
"name": "MDN Docs",
|
|
"href": "https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onhashchange"
|
|
}],
|
|
"polyfills": [
|
|
"jquery-hashchange",
|
|
"moo-historymanager",
|
|
"jquery-ajaxy",
|
|
"hasher",
|
|
"shistory"
|
|
]
|
|
}
|
|
!*/
|
|
/* DOC
|
|
Detects support for the `hashchange` event, fired when the current location fragment changes.
|
|
*/
|
|
define(['Modernizr', 'hasEvent'], function(Modernizr, hasEvent) {
|
|
Modernizr.addTest('hashchange', function() {
|
|
if (hasEvent('hashchange', window) === false) {
|
|
return false;
|
|
}
|
|
|
|
// documentMode logic from YUI to filter out IE8 Compat Mode
|
|
// which false positives.
|
|
return (document.documentMode === undefined || document.documentMode > 7);
|
|
});
|
|
});
|