【发布时间】:2012-12-24 10:57:15
【问题描述】:
我正在尝试在我的网络应用程序中使用谷歌字体。我加载谷歌字体的电话是:
$.get("https://www.googleapis.com/webfonts/v1/webfonts?key=xxxxxxx", function (result) {
var data = {};
console.log(result);
console.log($.parseJSON(result));
data.items = $.parseJSON(result).items;
});
上述调用在我的 3 个目标浏览器中给出以下结果:
火狐
console.log(result); ========> JSON string
console.log($.parseJSON(result)); ========> Successfully parsed the json string
data.items = $.parseJSON(result).items; ===> contains all google fonts
IE (9)
$.get callback is not executing.
铬
console.log(result); ========> Object
console.log($.parseJSON(result)); ========> null
谁能告诉我在上述 3 个浏览器上使用谷歌字体的通用方法?
【问题讨论】:
标签: javascript jquery google-font-api