私は現在、単純な ipad webapp テストピースに取り組んでおり、どういうわけか機能しない単純な switch ステートメントで立ち往生しています。javascripts window.location 文字列に従って要素をフォーマットしたい。これは、修正が簡単で恥ずかしいかもしれません。しかし、私はどういうわけかそれを理解していません: または、window.location について何か特別なことがありますか?
$(document).ready(function() {
path_c = window.location;
switch (path_c){
case "http://192.168.1.37/ryba_testground/":
$('#menu-item-22').addClass('current_page_item');
alert(path_c);
break;
case "http://192.168.1.37/ryba_testground/?page_id=7":
$('#menu-item-21').addClass('current_page_item');
break;
case "http://192.168.1.37/ryba_testground/?page_id=9":
$('#menu-item-20').addClass('current_page_item');
break;
case "http://192.168.1.37/ryba_testground/?page_id=11":
$('#menu-item-19').addClass('current_page_item');
break;
}
});
THX!