2011-07-12 212 views
0

我有一個網站託管,當我打開它在谷歌鉻所有工作正常,但在Firefox和IE瀏覽器的JavaScript不加載。jquery不加載在Firefox和Internet Explorer中

這是代碼:

<!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"> 
    <head> 
    <title>Me gustas cuando callas | ...es nombre de BLOG</title> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
    <meta http-equiv="Content-Language" content="es" /> 
    <meta name="description" content="Me gustas cuando callas es un proyecto nacido de la ilusión común de un grupo de personas de distintas edades, sexos y lugares del mundo, personas diferentes a quienes la casualidad o tal vez el destino reunió en un mismo lugar." /> 
    <meta name="author" content="[email protected]" /> 
    <meta name="keywords" content="me, gusta, cuando, callas" /> 
    <meta name="robots" content="all" /> 
    <link href="css/reset.css" rel="stylesheet" type="text/css"/> 
    <link href="css/layout.css" rel="stylesheet" type="text/css"/> 
    <link href="css/ui/jquery.css" rel="stylesheet" type="text/css"/> 
    <link rel="shortcut icon" type="image/x-icon" href="css/img/favicon.ico" /> 
    <script language="javascript" type="text/javascript" src="js/jquery.js"></script> 
    <script language="javascript" type="text/javascript" src="js/cufon.js"></script> 
    <script language="javascript" type="text/javascript" src="js/fonts/caviardreams.js"></script> 
    <script language="javascript" type="text/javascript" src="js/plugins.js"></script> 
    <script language="javascript" type="text/javascript" src="js/main.js"></script> 
</head> 
<body>CONTENT</body></html> 

而且我已經意識到,它必須是jQuery的,因爲我有一個警報(「測試」);它的工作原理,但全部在$(document).ready(function(){...});沒有。

幫助PLS! :(

+1

檢查開發者工具,是發現在所有的文件嗎? –

+0

jQuery(document).ready();工作?如果您正在加載jQuery並且$()不起作用,那麼您可能與另一個庫發生衝突,並且jQuery進入無衝突模式。 –

+0

我沒有其他庫和文件的創建。 – jsertx

回答

0

那是因爲我使用的保留名稱「VAR類」

0

幾種可能性:

1)的代碼被包裝在document.ready。頁面是否完全加載完成?

也許有一個破碎的圖像,超時api調用,或其他資源導致頁面不能完全加載到一個瀏覽器,而在其他瀏覽器它在一定的時間內切斷呼叫。 編輯

我檢查鉻的開發者控制檯,以及一些圖片無法載入

ui-bg_highlight-soft_100_f6f6f6_1x100.png Failed to load resource: the server responded with a status of 404 (Not Found)

我敢打賭,其他瀏覽器不觸發ready因爲這個原因。

2)有時瀏覽器解釋並修復鏈接的問題如下所示:

/js/jsfile.js 
http://www.mysite.com//js/jsfile.js 

js/jsfile.js 
http://www.mysite.comjs/jsfile.js 

當那些被包括作爲相對鏈接地址。也許有一個URL錯誤,一個瀏覽器爲你修復它,另一個瀏覽器正確解釋它?

3)另一種可能是使用jQuery和jQuery的其他js文件的衝突之一進入無衝突模式造成$()不工作,而是使用jQuery()

+0

這是網址,我已經試過了你所寫的全部內容:/ [link} http://megustascuandocallas.com/如果你點擊「crear cuenta」在頂部,它打開一個模式框jquery加載。 – jsertx

+0

這是因爲我使用了一個保留名稱「var class」 – jsertx

0

你看到了jQuery的js如果你在FF或IE中輸入這個文件?

http://<yoursite_URL>/js/jquery.js 

這種嘗試,以及:

<script language="javascript" type="text/javascript" src="/js/jquery.js"></script> 

您也可以與外部jQuery庫嘗試看看,如果它使任何差異:

,除非你有自定義的,這可能是一個更好的選擇代碼裏面jQuery的:)

<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.min.js" type="text/javascript"></script> 
0

如果你加載頁面在Firefox(我谷歌搜索它)與螢火蟲啓用,那麼你在文件js /插件中出現錯誤。JS:

flashver.split不是一個函數

我不知道該行代碼是幹什麼的,但flashVer在開始時設置爲-1,我想它是意味着被設置爲一個字符串,但不是由於某種原因。

相關問題