Skip to content

Commit c211663

Browse files
committed
#73 Mismatched anonymous define() module because of #57
1 parent dd55b4c commit c211663

8 files changed

+77
-55
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ npm install html5-history-api
1313
### Browser Support:
1414

1515
`history.js` - IE8+ and other browsers
16+
1617
`history.ielte7.js` - IE6+ and other browsers
1718

1819
### For library developers:
@@ -218,6 +219,7 @@ npm install html5-history-api
218219
### Поддержка браузеров:
219220

220221
`history.js` - IE8+ и другие браузеры
222+
221223
`history.ielte7.js` - IE6+ и другие браузеры
222224

223225
### Для разработчиков библиотек:

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "history",
33
"repo": "devote/HTML5-History-API",
44
"description": "HTML5 History API expansion for browsers not supporting pushState, replaceState",
5-
"version": "4.2.0",
5+
"version": "4.2.1",
66
"keywords": ["history", "pushState", "replaceState"],
77
"main": "history.js",
88
"scripts": ["history.js"],

component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "html5-history-api",
3-
"version": "4.2.0",
3+
"version": "4.2.1",
44
"description": "HTML5 History API expansion for browsers not supporting pushState, replaceState",
55
"main": "history.js",
66
"scripts": ["history.js"],

history.ielte7.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,35 @@
11
/*!
2-
* History API JavaScript Library v4.2.0
2+
* History API JavaScript Library v4.2.1
33
*
44
* Support: IE6+, FF3+, Opera 9+, Safari, Chrome and other
55
*
6-
* Copyright 2011-2014, Dmitrii Pakhtinov ( spb.piksel@gmail.com )
6+
* Copyright 2011-2015, Dmitrii Pakhtinov ( spb.piksel@gmail.com )
77
*
88
* http://spb-piksel.ru/
99
*
1010
* Dual licensed under the MIT and GPL licenses:
1111
* http://www.opensource.org/licenses/mit-license.php
1212
* http://www.gnu.org/licenses/gpl.html
1313
*
14-
* Update: 2014-11-06 21:35
14+
* Update: 2015-05-22 13:02
1515
*/
1616
(function(factory) {
1717
if (typeof define === 'function' && define['amd']) {
18-
// https://github.com/devote/HTML5-History-API/issues/57#issuecomment-43133600
19-
define(typeof document !== "object" || document.readyState !== "loading" ? [] : "html5-history-api", factory);
20-
} else {
21-
factory();
18+
// https://github.com/devote/HTML5-History-API/issues/73
19+
var rndKey = '[history' + (new Date()).getTime() + ']';
20+
var onError = requirejs['onError'];
21+
factory.toString = function() {
22+
return rndKey;
23+
};
24+
requirejs['onError'] = function(err) {
25+
if (err.message.indexOf(rndKey) === -1) {
26+
onError.call(requirejs, err);
27+
}
28+
};
29+
define([], factory);
2230
}
31+
// execute anyway
32+
factory();
2333
})(function() {
2434
// Define global variable
2535
var global = (typeof window === 'object' ? window : this) || {};

history.ielte7.min.js

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

history.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,35 @@
11
/*!
2-
* History API JavaScript Library v4.2.0
2+
* History API JavaScript Library v4.2.1
33
*
44
* Support: IE8+, FF3+, Opera 9+, Safari, Chrome and other
55
*
6-
* Copyright 2011-2014, Dmitrii Pakhtinov ( spb.piksel@gmail.com )
6+
* Copyright 2011-2015, Dmitrii Pakhtinov ( spb.piksel@gmail.com )
77
*
88
* http://spb-piksel.ru/
99
*
1010
* Dual licensed under the MIT and GPL licenses:
1111
* http://www.opensource.org/licenses/mit-license.php
1212
* http://www.gnu.org/licenses/gpl.html
1313
*
14-
* Update: 2014-11-06 21:35
14+
* Update: 2015-05-22 13:02
1515
*/
1616
(function(factory) {
1717
if (typeof define === 'function' && define['amd']) {
18-
// https://github.com/devote/HTML5-History-API/issues/57#issuecomment-43133600
19-
define(typeof document !== "object" || document.readyState !== "loading" ? [] : "html5-history-api", factory);
20-
} else {
21-
factory();
18+
// https://github.com/devote/HTML5-History-API/issues/73
19+
var rndKey = '[history' + (new Date()).getTime() + ']';
20+
var onError = requirejs['onError'];
21+
factory.toString = function() {
22+
return rndKey;
23+
};
24+
requirejs['onError'] = function(err) {
25+
if (err.message.indexOf(rndKey) === -1) {
26+
onError.call(requirejs, err);
27+
}
28+
};
29+
define([], factory);
2230
}
31+
// execute anyway
32+
factory();
2333
})(function() {
2434
// Define global variable
2535
var global = (typeof window === 'object' ? window : this) || {};

history.min.js

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"*.js"
88
]
99
}],
10-
"version": "4.2.0",
10+
"version": "4.2.1",
1111
"description": "HTML5 History API expansion for browsers not supporting pushState, replaceState",
1212
"main": "history.js",
1313
"repository": {

0 commit comments

Comments
 (0)