(cdn_url = "", LazyLoad.js("maps/map0.js" {maps_loaded[0] = true}))
它一直在说Uncaught SyntaxError: Unexpected token {
现在说它缺少[
整行:
if (("" == window.location.port || "80" == window.location.port) && !/\/wiki/.test(window.location.pathname)) window.location = window.location.protocol + "//" + window.location.hostname + ":" + config.http_port + window.location.pathname;
var map = [],
on_map = [],
maps_loaded = {}, cdn_url = "localhost";
"80" != window.location.port ? (cdn_url = "", LazyLoad.js("maps/map0.js", {
maps_loaded[0] = true
})) {
maps_loaded[0] = true
})) : LazyLoad.js(cdn_url + "maps/map0.js?" + map_hashes[0], function () {
maps_loaded[0] = true
});
答案 0 :(得分:4)
您之后是否需要逗号:
"maps/map0.js"
之前:
{maps_loaded[0]=true}
答案 1 :(得分:2)
形成我所看到的 - 在第一个参数传递给LazyLoad.js函数后,您将失去昏迷 - >它应该是(cdn_url =“”,LazyLoad.js(“maps / map0.js”,{maps_loaded [0] = true}))