2012-04-23 69 views
2

我在Firebug Web開發加載我的網站的時候得到一個錯誤:錯誤缺少 '語句之前' - @import

​​

下面是一個完整的文件:

/*! 
* jQuery UI CSS Framework 1.8.19 
* 
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) 
* Dual licensed under the MIT or GPL Version 2 licenses. 
* http://jquery.org/license 
* 
* http://docs.jquery.com/UI/Theming 
*/ 
@import "jquery.ui.base.css"; 
@import "jquery.ui.theme.css"; 

任何建議?

+1

您是否將CSS文件導入爲腳本? – Pointy 2012-04-23 15:47:37

+0

這個[link](http://forum.jquery.com/topic/another-missing-before-statement-problem-but-other-posts-have-not-helped-me-any)可能有幫助 – 2012-04-23 15:51:58

+0

@b_dubb這就是一個奇怪的問題的好鏈接,但這是關於一個CSS文件生成JavaScript錯誤。 – Pointy 2012-04-23 16:13:53

回答

7

如果您將CSS加載爲JavaScript,那麼您將爲CSS文件獲取JavaScript錯誤的唯一原因是。

這聽起來可能有些傲慢,但你也許這樣做的:

<script src="jquery.ui.base.css"></script> 

如果是的話,它應該改爲:

<link rel="stylesheet" href="jquery.ui.base.css" /> 

。當然,這是一個比較容易犯的錯誤,如果你正在使用一些jQuery導入的東西,但我們需要看到更多的源代碼來確定。

+0

在我的情況下,我是動態加載腳本和CSS,這是我的問題:)謝謝 – AzurGroup 2013-04-03 13:04:28