延迟加载Javascript,对象不是从IE8缓存创建的
不幸的是,这个错误没有发生在我的应用程序之外 场景 index.php延迟加载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
<?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)
- 真->未定义
有人知道为什么会执行警报(true)但未设置某些内容吗?解决方案,甚至修复了Internet Explorer 6
window.something = {};
something = {};
alert(true);
window.something = {};