有api: http://api.yandexzaim.ru/api/soft_uslugi2
如果我在视觉工作室项目中通过api发言:
function getProducts() {
$.getJSON("/api/soft_uslugi2",
function (data) {
$('#products').empty(); // Clear the table body.
// Loop through the list of products.
$.each(data, function (key, val) {
// Add a table row for the product.
var row = '<td>' + val.uname + '</td><td>' + val.id + '</td>';
$('<tr/>', { text: row }) // Append the name.
.appendTo($('#products'));
});
});
}
$(document).ready(getProducts);
没关系,但是如果我转向相同的服务器api
function getProducts() {
$.getJSON("http://api.yandexzaim.ru/api/soft_uslugi2",
function (data) {
$('#products').empty(); // Clear the table body.
// Loop through the list of products.
$.each(data, function (key, val) {
// Add a table row for the product.
var row = '<td>' + val.uname + '</td><td>' + val.id + '</td>';
$('<tr/>', { text: row }) // Append the name.
.appendTo($('#products'));
});
});
}
$(document).ready(getProducts);
什么都不回......问题是什么?