【发布时间】:2015-09-09 11:32:59
【问题描述】:
如果您在 IE11 中打开此页面,CSS 和 jQuery 不会加载:http://javasmart.gooberdev.com/
如果您刷新页面一次,甚至两次,它仍然无法加载。但是如果你连续按 F5 很多次,CSS 和 jQuery 最终会加载并且页面正确显示。
这是我见过的最奇怪的错误之一,坦率地说,我不知道是什么原因造成的。 **仅在 IE 中出现。 Chrome 和 Firefox 运行良好。
Magento head.phtml 文档:
<meta http-equiv="Content-Type" content="<?php echo $this->getContentType() ?>" />
<title><?php echo $this->getTitle() ?></title>
<meta name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" />
<meta name="keywords" content="<?php echo htmlspecialchars($this->getKeywords()) ?>" />
<meta name="robots" content="<?php echo htmlspecialchars($this->getRobots()) ?>" />
<link rel="icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<!--[if lt IE 7]>
<script type="text/javascript">
//<![CDATA[
var BLANK_URL = '<?php echo $this->helper('core/js')->getJsUrl('blank.html') ?>';
var BLANK_IMG = '<?php echo $this->helper('core/js')->getJsUrl('spacer.gif') ?>';
//]]>
</script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="/skin/frontend/magpassion/relank/css/custom.css" media="all" />
<script type="text/javascript" src="http://fast.fonts.net/jsapi/ea7ed50d-f26c-4089-bf7d-063665c359e7.js"></script>
<link href='http://fonts.googleapis.com/css?family=Roboto:400,500,400italic,500italic' rel='stylesheet' type='text/css' />
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" />
<?php echo $this->getCssJsHtml() ?>
<?php echo $this->getChildHtml() ?>
<?php echo $this->helper('core/js')->getTranslatorScript() ?>
<?php echo $this->getIncludes() ?>
【问题讨论】:
-
您的
<head>表明您正在加载三个不同版本的jQuery。只会使用最后一个加载的,仅供参考。 -
你的页面需要很长时间才能加载,也许你应该下载从网络加载的脚本/css并将它们包含在你的项目中。
-
我看到了 jQuery 版本 1.4.2、1.6.4、1.7.2 和 1.10.2。我认为这是一个新的个人记录。
标签: jquery css html internet-explorer internet-explorer-11