reactのjsxの中のajaxでapi.jsonの一部だけ取り出したいのですが、どのようにすればいいでしょうか。json全部の取得はうまくいっています。
javascript
1$.ajax({ 2752 url: this.props.url, 3753 type: 'GET', 4754 dataType: 'json', 5755 success: function(data) { 6756 this.setState({data: data}); 7757 }.bind(this), 8758 error: function(xhr, status, err) { 9759 console.log(this.props.targetURL, status, err.toString()); 10760 }.bind(this) 11761 });
api.json
1 { 2 "id": 3342124, 3 "message": "Hi!", 4 "user": { 5 "id": 3456, 6 "name": "Taro Yamada", 7 "image_url": "/images/taro.png" 8 } 9 }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/09/17 00:56