![](/img/trans.png)
[英]Asynchronous translation with Google Translate API. What am I doing wrong?
[英]Trying to pull JSON data via the crunchbase API. What am I doing wrong?
<html>
<head>
<title>Result</title>
<link rel='stylesheet' type='text/css' href='stylesheet.css'/>
</head>
<body>
<div></div>
<script>
$(document).ready(function() {
$.getJSON("http://api.crunchbase.com/v/1/company/facebook.js?api_key=mgxpds8ja7f6cncwd39caed7")
});
</script>
</body>
</html>
我觉得有一些非常容易让我失踪,但我似乎无法取消任何数据。
获取JSON后,下一步需要添加回调并对JSON数据执行一些操作,
$.getJSON("http://api.crunchbase.com/v/1/company/facebook.js?api_key=mgxpds8ja7f6cncwd39caed7", function(data){
//CALLBACK
console.log(data); //LIST DATAs
//Do Something over here
})
好。 我看到了几件事......
检查下面的HTML,就像一个魅力,但对于x域错误...
<html>
<head>
<title>Result</title>
<link rel='stylesheet' type='text/css' href='stylesheet.css'/>
</head>
<body>
<div id="results"></div>
<script>
$(document).ready(function() {
$("#results").html( function () {
return $getJSON("http://api.crunchbase.com/v/1/company/facebook.js?api_key=mgxpds8ja7f6cncwd39caed7")
});
});
</script>
</body>
</html>
谢谢!
@leo。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.