Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/43.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
延迟加载Javascript,对象不是从IE8缓存创建的_Javascript_Caching_Internet Explorer 8 - Fatal编程技术网

延迟加载Javascript,对象不是从IE8缓存创建的

延迟加载Javascript,对象不是从IE8缓存创建的,javascript,caching,internet-explorer-8,Javascript,Caching,Internet Explorer 8,不幸的是,这个错误没有发生在我的应用程序之外 场景 index.php <?php header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s').'GMT'); header('Cache-Control: no-cache, must-revalidate'); header('Pragma: no-cache'); ?> <!DOCTYP

不幸的是,这个错误没有发生在我的应用程序之外

场景

index.php

<?php
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').'GMT');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Lazy loader</title>
</head>
<body>
...
<script type="text/javascript" src="internal.js"></script>
...
</body>
</html>
有效结果为

  • 未定义->真实->对象(±新请求)
  • true->object(±缓存的javascript)
但有时,当我按F5时,我会

  • 真->未定义

有人知道为什么会执行警报(true)但未设置某些内容吗?

解决方案,甚至修复了Internet Explorer 6

window.something = {};
something = {};
alert(true);
window.something = {};