This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <map> | |
#include <string> | |
#include <iostream> | |
using namespace std; | |
/** | |
* Split the HTTP GET query string into the parameters. | |
* | |
* e.g. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>POST TEXT HTML</title> | |
<script type="text/javascript" | |
src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
<script type="text/javascript"> | |
// <!-- | |
$(function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'complex' | |
# モルフォチョウの多層膜を再現して各波長に対する反射率を計算するプログラム | |
# | |
# モルフォチョウの翅を 11層の多層膜をと見立て、 | |
# クチクラ層 (屈折率1.6, 膜幅65nm), 空気層 (屈折率1.0, 膜幅130nm) として計算 | |
# | |
# 参考: 構造色研究会「エクセルで多層膜干渉!! 」 | |
# http://mph.fbs.osaka-u.ac.jp/~ssc/excelde/excelde.html | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"key1": "value1", "key2": "value2"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
content-type: application/json; | |
charset=utf-8 | |
{ "key1": "value1", "key2": "value2" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 同じドメインの test.cgi から JSONデータを取得して表示 | |
$.getJSON("test.cgi", function(data){ | |
alert("key1:" + data.key1); | |
alert("key2:" + data.key2); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 同じドメインの test.cgi に test.cgi?param1=value1¶m2=value2 としてリクエストをかけ、 | |
// JSONデータを取得して表示 | |
$.getJSON("test.cgi", | |
{ | |
param1: "value1", | |
param2: "value2" | |
}, | |
function(data){ | |
alert("key1:" + data.key1); | |
alert("key2:" + data.key2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
callback({ "key1": "value1", "key2": "value2" }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// クロスドメインの http://hoge.com/test.cgi からJSONPを取得 | |
$.getJSON("http://hoge.com/test.cgi?callback=?", | |
function(data){ | |
alert("key1:" + data.key1); | |
alert("key2:" + data.key2); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 同じドメインの 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); |
OlderNewer