http://jquery-ui.googlecode.com/svn/tags/1.8.23/themes/からjQueryテーマのリストを取得する方法を知っている人はいますか?
ユーザーがテーマを動的に切り替えることができるテーマローラーを使用して、単純なWebページを作成しています。
作業フィドル-右上隅のテーマをクリックして、新しいテーマを選択します。
現在、リストは次のようにハードコーディングされています。
<div id="theme-list">
<ul>
<li class="themes-el ui-state-highlight" data-theme="cupertino">cupertino</li>
<li class="themes-el" data-theme="hot-sneaks">hot-sneaks</li>
<li class="themes-el" data-theme="smoothness">smoothness</li>
<li class="themes-el" data-theme="pepper-grinder">pepper-grinder</li>
<li class="themes-el" data-theme="ui-lightness">ui-lightness</li>
<li class="themes-el" data-theme="ui-darkness">ui-darkness</li>
<!-- and more -->
</ul>
</div>
このテーマのリストをURLhttp://jquery-ui.googlecode.com/svn/tags/1.8.23/themes/から取得する方法はありますか?(crossDomain:http ://www.w3.org/TR/cors/#access-control-allow-origin-response-hea )
試しましたが、以下のコードで失敗しました。
$.ajax({
url: 'http://jquery-ui.googlecode.com/svn/tags/1.8.23/themes/',
dataType: 'text',
beforeSend: function ( xhr ) {
xhr.setRequestHeader("Access-Control-Allow-Origin", 'http://jquery-ui.googlecode.com');
xhr.setRequestHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS");
},
crossDomain: true,
success: function (data) {
alert(data);
},
error: function (jqXHR, textStatus, errorThrown) {
alert(errorThrown + ' ' + textStatus + ' ' + jqXHR.responseText);
}
});
私はここで多くを逃しているように感じます..どんな洞察も本当に役に立ちます。