Skip to content

Instantly share code, notes, and snippets.

@junpeitsuji
Created September 21, 2013 10:35
Show Gist options
  • Save junpeitsuji/6649291 to your computer and use it in GitHub Desktop.
Save junpeitsuji/6649291 to your computer and use it in GitHub Desktop.
// 同じドメインの test.cgi から JSONデータを取得して表示
var req = new XMLHttpRequest();
req.open('GET', 'test.cgi', false);
req.send(null);
if(req.status == 200) {
var json = req.responseText;
var data = eval(json);
alert("key1:" + data.key1);
alert("key2:" + data.key2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment