source: branches/version-2_11-dev/html/user_data/packages/sphone/js/favorite.js @ 21504

Revision 21504, 1.2 KB checked in by 468, 12 years ago (diff)

#1629 お気に入り登録、MyPage?のお届け先の追加、MyPage?お届け先の追加時の郵便番号から住所自動入力の不具合を修正

  • Property svn:mime-type set to text/plain
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("お気に入りに登録しました");
27                  $(".btn_favorite").html("<p>お気に入り登録済み</p>");
28              } else {
29                  alert("お気に入りの登録に失敗しました");
30              }
31              $.mobile.hidePageLoadingMsg();
32           }
33    });
34}
Note: See TracBrowser for help on using the repository browser.