0
我在jsp中使用jQuery 1.8.2,jQuery ui 1.9.1,Firefox 16.0.1,我試圖讓按鈕顯示一個圖標。我試過了:如何在按鈕中使用jQuery設置默認圖標
$('button').button({ icons: {primary: "ui-icon-triangle-1-s" } });
,並在div:
<div id="buttonDiv" style="text-align: center;"> <button class="btn-primary" type="button" id="confirmationButton" value="confirm">Confirmation</button> </div>
,然後我試着用一個ID,一個類,類型設置爲按鈕,等等,但由於某種原因它不顯示。
我知道,如果我試圖使按鍵輸入按鈕,這將不會被設計工作,當我使用
$('button').button()
等。作爲一個選擇它的正常工作。
這裏是我的CDN聲明:
<!-- Reference the theme's stylesheet on the Google CDN -->
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/themes/ui-lightness/jquery-ui.css" rel="stylesheet" type="text/css"/>
<!-- Reference jQuery and jQuery UI from the CDN. Remember that the order of these two elements is important -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js" type="text/javascript"></script>
缺少什麼我在這裏?
我錯過了對圖標本身的引用。所以如果我選擇一個主題,我也必須參考這些圖標? –
我編輯了我原來的答案。來自google的遠程jquery-ui.css使用圖像的相對路徑,我推測這些路徑使用http://ajax.googlepais.com/...作爲其絕對路徑擴展。 – Brian
我有一切權利,但我現在看到它,我遺漏了我的按鈕語句函數。我忽略在這裏檢查明顯的。謝謝! –