2
我有以下的错误5次:未捕获的ReferenceError:无效的左侧表达
Uncaught ReferenceError: Invalid left - hand side expression in postfix operation
。你们看到,为什么?感谢你的帮助 !
toQueryParams: function (string, separator) {
var match = _(string).strip().match(/([^?#]*)(#.*)?$/);
if (!match) return {};
return _(match[1].split(separator || '&')).reduce(function (hash, pair) {
if ((pair = pair.split('='))[0]) {
var key = decodeURIComponent(pair.shift()),
value = pair.length > 1 ? pair.join('=') : pair[0];
if (value != undefined) value = decodeURIComponent(value);
if (key in hash) {
if (!_.isArray(hash[key])) hash[key] = [hash[key]];
hash[key].push(value);
}
// Uncaught ReferenceError: Invalid left - hand side expression in postfix operation
// Uncaught ReferenceError: Invalid left - hand side expression in postfix operation
// Uncaught ReferenceError: Invalid left - hand side expression in postfix operation
// Uncaught ReferenceError: Invalid left - hand side expression in postfix operation
// Uncaught ReferenceError: Invalid left - hand side expression in postfix operation
else hash[key] = value;
}
return hash;
}, {});
},
请创建一个http://jsfiddle.net/演示。 –
以及它是一个非常大的JS文件的一部分。我会错过依赖关系...我会看看我能做些什么 –
这里是http://jsfiddle.net/YcN4F/我已经更新了代码来尝试一些东西,但在生产中不起作用。 –