###ajaxに変数を受け渡すには??
困っていること
下記のソースのajaxのsuccessの箇所の「CountChild」を変数の値に置き換えることができず困っています。
知りたいこと:
下記のソースのajaxのsuccessの箇所の「CountChild」を変数の値に置き換える方法をご教示いただきたいです。
やったこと:
当該変数の箇所の「varを外してみる」「""」をつけてみるなど。
対象ソース
javascript
1<script type="text/javascript"> 2 window.onload = function () { 3 var CountChild = 1 ; 4 $.ajax( 5 { 6 url:'../api/child_info.php', 7 type:'Get', 8 dataType:'json', 9 // data:data, 10 error:function(){}, 11 success: function(data){ 12 document.basic.child_info_last_name_CountChild.value = data.last_name; 13 document.basic.child_info_name_CountChild.value = data.name; 14 var birthday_full = new Date(data.birthday); 15 document.basic.child_info_birth_year_CountChild.value = birthday_full.getFullYear(); 16 document.basic.child_info_birth_month_CountChild.value = birthday_full.getMonth() + 1; 17 document.basic.child_info_birth_day_CountChild.value = birthday_full.getDate(); 18 } 19 } 20 ); 21} 22</script>

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/03/09 14:50
2017/03/09 14:55
2017/03/09 14:58