source: branches/version-2_12-multilang/html/user_data/packages/sphone_en/js/favorite.js @ 22183

Revision 22183, 1.1 KB checked in by adachi, 11 years ago (diff)

#1995
js内メッセージを抽出

Line 
1/*------------------------------------------
2お気に入りを登録する
3------------------------------------------*/
4function fnAddFavoriteSphone(favoriteProductId) {
5    $.mobile.showPageLoadingMsg();
6    //送信データを準備
7    var postData = {};
8    $("#form1").find(':input').each(function(){ 
9        postData[$(this).attr('name')] = $(this).val(); 
10    });
11    postData["mode"] = "add_favorite_sphone";
12    postData["favorite_product_id"] = favoriteProductId;
13
14    $.ajax({
15           type: "POST",
16           url: $("#form1").attr('action'),
17           data: postData,
18           cache: false,
19           dataType: "text",
20           error: function(XMLHttpRequest, textStatus, errorThrown){
21            alert(textStatus);
22            $.mobile.hidePageLoadingMsg();
23           },
24           success: function(result){
25              if (result == "true") {
26                  alert("j_favorite_001");
27                  $(".btn_favorite").html(fnT("j_favorite_002"));
28              } else {
29                  alert(fnT("j_favorite_003"));
30              }
31              $.mobile.hidePageLoadingMsg();
32           }
33    });
34}
Note: See TracBrowser for help on using the repository browser.