2015-06-23 46 views
0
後負荷

如果您在IE11中打開此頁面時,CSS和jQuery不加載:http://javasmart.gooberdev.com/jQuery和CSS只是衆多刷新

如果刷新頁面一次,甚至兩次,但它仍然不會加載。但是如果你連續多次點擊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() ?> 
+2

你''表明你裝載三個不同版本的jQuery。只有最後一個加載將被使用,僅供參考。 – TylerH

+0

你的頁面需要這麼長的時間才能加載,也許你應該下載從Web上加載的腳本/ css並將它們包含在你的項目中。 – loli

+0

我看到jQuery版本1.4.2,1.6.4,1.7.2和1.10.2。我認爲這是一個新的個人記錄。 – isherwood

回答

2

我只得到問題當IE注重X-UA標籤在你的頭,迫使IE8的標準。一堆JavaScript無法加載,並且頁面的其餘部分翻倒。
如果我忽略此標籤並使用F12使用Edge進行渲染,該頁面始終可以完美地爲我工作。

<meta http-equiv="X-UA-Compatible" content="IE=8" /> 

有好就可以了張貼在這裏:

"X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE"

+0

明白了!將其更改爲IE =邊緣修復了問題。 –