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

Revision 22796, 1.2 KB checked in by h_yoshimoto, 11 years ago (diff)

#2236 2.12.3リリース以降の2.12-devへのコミット差し戻し

  • 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.