Skip to content

Instantly share code, notes, and snippets.

@mapserver2007
Created June 6, 2011 13:14
Show Gist options
  • Save mapserver2007/1010220 to your computer and use it in GitHub Desktop.
Save mapserver2007/1010220 to your computer and use it in GitHub Desktop.
HTTPモジュールのテスト
<?php
$name = $_POST["name"];
$result = array(
"result" => $name
);
echo json_encode($result);
?>
<html>
<head>
<script type="text/javascript" src="mix.js"></script>
<script type="text/javascript" src="mix.modules.js"></script>
<script type="text/javascript" src="test.js"></script>
</head>
<body onload="start();">
kita-
</body>
</html>
function start() {
var obj = Module.create({}).mix(Http);
obj.xhr(
"http://localhost/eclipse/mixjs/ajax.php",
{name: "test"},
success,
null,
startFunc,
endFunc,
{testParam: "kita------"}
);
}
function startFunc(args) {
console.log(args.testParam);
}
function endFunc() {
console.log("end");
}
function success(data) {
console.log(data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment