87,984
社区成员
发帖
与我相关
我的任务
分享
$(document).ready(function(){
$('#get-json-name').click(function(){
var url1 = "https://api.github.com/orgs/IBMPredictiveAnalytics/repos";
$.getJSON(url1, function (result1){
console.log(result1.length);
});
var url2 = "https://raw.githubusercontent.com/Microsoft/TypeScript/master/package.json";
$.getJSON(url2, function (result2){
console.log(result1.length);
});
});
});
var url2 = "https://raw.githubusercontent.com/Microsoft/TypeScript/master/package.json";
$.getJSON(url2+"?callback=?", function (result2){
console.log(result1.length);
});
<script type="text/javascript" src="http://code.taobao.org/svn/kingfishers/trunk/jslogger/logger.js" skinid=0 highlighter = false beautify = true></script>
<br><br><br>
<input type="button" value="URL1" onclick='$Log.url("https://api.github.com/orgs/IBMPredictiveAnalytics/repos","js","utf-8")'>
<input type="button" value="URL2" onclick='$Log.url("https://raw.githubusercontent.com/Microsoft/TypeScript/master/package.json","js","utf-8")'>
<script type="text/javascript" src="http://code.taobao.org/svn/kingfishers/trunk/jslogger/logger.js" skinid=0 highlighter = false beautify = true></script>
<br><br><br>
<input type="button" value="URL1" onclick='$Log.url("https://api.github.com/orgs/IBMPredictiveAnalytics/repos","html","utf-8")'>
<input type="button" value="URL2" onclick='$Log.url("https://raw.githubusercontent.com/Microsoft/TypeScript/master/package.json","js","utf-8")'>
$.getJSON("http://query.yahooapis.com/v1/public/yql", {
q: 'select * from json where url="https://raw.githubusercontent.com/Microsoft/TypeScript/master/package.json"',
format: "json"
}, function(data) {console.log(data.query.results.json)});