mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 12:34:47 -04:00
Hopefully fixed href bugs for all browsers now.
This commit is contained in:
parent
8fea7bfb74
commit
68497e749b
2 changed files with 14 additions and 2 deletions
|
@ -2,7 +2,19 @@
|
|||
modulejs.define('model/entry', ['_', 'core/types', 'core/ajax'], function (_, types, ajax) {
|
||||
|
||||
var domain = document.domain,
|
||||
location = document.location.href.replace(/^.*:\/\/[^\/]*/, '').replace(/[^\/]*$/, ''),
|
||||
location = (function () {
|
||||
|
||||
var location = document.location.pathname.replace(/[^\/]*$/, ''),
|
||||
testpathname = '/a b',
|
||||
a = document.createElement('a');
|
||||
|
||||
a.href = testpathname;
|
||||
if (a.pathname === testpathname) {
|
||||
location = encodeURIComponent(location).replace(/%2F/ig, '/').replace(/'/g, '%27');
|
||||
}
|
||||
|
||||
return location;
|
||||
}()),
|
||||
|
||||
|
||||
// utils
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue