【发布时间】:2012-12-14 21:20:51
【问题描述】:
这是我第一次使用 JSON,我是 web 开发中的菜鸟。在他们的网站 (http://www.json.org/JSONRequest.html) 上,他们建议使用 JSONRequest.get。 但是,我不断收到错误“未定义 JSONRequest”。我的代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta Content-Type= application/jsonrequest >
<title>Insert Events Page</title>
</head>
<body>
<h2>List of ALL events: </h2><br>
<script type="text/javascript">
try {
JSONRequest.get("http://localhost:8888/mma/event/allevents", function(sn, response, exception){
alert(exception || response);
});
}
catch(e) {
alert(e);
}
</script>
</body>
</html>
【问题讨论】:
-
欢迎来到 SO。请提供更多关于您想要做什么的信息。此外,如果您提供一些您已经尝试过的代码,您更有可能获得问题的高质量答案。这里不是人们为你建造东西的地方,而是改进你已经尝试过的东西。
标签: javascript json get