- 95 名前:デフォルトの名無しさん mailto:sage [2016/03/28(月) 19:45:04.22 ID:UwAduPwe.net]
- >>93
var getJson = function() { var x; var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if (xhr.readyState == 4 && xhr.status == 200) { x = JSON.parse(xmlhttp.responseText); } } xhr.open('GET', 'test.json', false); xhr.responseType = 'JSON'; xhr.send(null); return x; }; var data = getJson(); jQuery ajaxを使った方がいいと思うけど
|

|