Web アプリケーションで Google フォントを使用しようとしています。Googleフォントをロードするための私の呼び出しは次のとおりです:
$.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
イエ(9)
$.get callback is not executing.
クロム
console.log(result); ========> Object
console.log($.parseJSON(result)); ========> null
上記の3つのブラウザすべてでGoogleフォントを使用する一般的な方法を教えてください。