【发布时间】:2014-07-04 22:24:44
【问题描述】:
这里的代码在 Firefox 和 Chrome 中完美运行,即使是过时的版本。 但在 Internet Explorer 中,它不适用于 IE 7 或 8。 未经 IE 6 测试但不应该工作(这不是问题) 未使用 IE 9 测试(没有)。
我得到的错误是:“有一个错误,因为 local_load 为空或未定义。”
我的 php 页面中有这个调用:
<html>
<head>...</head>
<body>
[... some html...]
<?php
include 'footer.php';
?>
<script>
$(document).ready(function() {
local_load();
initialize();
return true;
});
</script>
</body>
</html>
local_load() 位于通过 footer.php 加载的外部 js 文件中。 Local_load() 的内容是这样的:
function local_load() {
if ($.jStorage.storageAvailable() == true) {
// we need to execute regulary this function.
// It will stop automatically once the whole job is done.
interval = setInterval(function() {
display_something(true)
}, 700, true);
}
else {
Nostorage();
}
return true;
}
================= 回答你的问题:
从浏览器的来源复制:
functions-map.js 内容:
function local_load() {
if ($.jStorage.storageAvailable() == true) {
poi_recept = $.jStorage.get("poi_ids");
if (poi_recept.length > 0) {
poi_recept_compte = -1;
poi_recept_interval = setInterval(function() {
display_autourde(true)
}, 700, true);
}
}
else {
Nostorage();
}
return true;
}
【问题讨论】:
-
可能在加载
footer.php时遇到语法错误,导致无法定义函数。 -
有一个错误,因为听起来不像是来自 IE 的真正错误消息。确切的错误信息是什么?
-
您需要展示更多关于
local_load()的实际加载方式。如果它在动态加载的脚本文件中,那么您将有一个计时漏洞,该漏洞会因缓存/浏览器/网络情况而异。 -
真正的错误信息是:SCRIPT5007: La valeur de la propriété "local_load" est null ou non définie, pas un objet function
-
也许您只能向我们展示服务器生成的干净 HTML。您在问题中包含的语言越多,您等待答案的时间就越长。
标签: javascript function internet-explorer