Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
输出JSON-LD脚本,通过angularjs$http加载_Angularjs_Json Ld - Fatal编程技术网

输出JSON-LD脚本,通过angularjs$http加载

输出JSON-LD脚本,通过angularjs$http加载,angularjs,json-ld,Angularjs,Json Ld,我试图通过$http获取并输出页面上的JSON-LD数据,如下所示: angular.element(document).ready(function(){ $http({ url:“/product init”, 方法:'POST', 数据:{product_id:$scope.product_id} }).然后(功能(d){ $scope.product=d.data; $scope.jsonLd={ “@context”:”http://schema.org", @type:“产品” /

我试图通过$http获取并输出页面上的JSON-LD数据,如下所示:

angular.element(document).ready(function(){
$http({
url:“/product init”,
方法:'POST',
数据:{product_id:$scope.product_id}
}).然后(功能(d){
$scope.product=d.data;
$scope.jsonLd={
“@context”:”http://schema.org",
@type:“产品”
//空中交通管制。。。。。
}
$('#json ld content').html(json.stringify($scope.jsonLd));
},功能(d){
警报(“产品初始化错误”);
});
});


您引用的结构化数据linter不会评估JavaScript。试试看。

事实上,我发现的示例使用JQuery并处理该linter。然而,谷歌的工具在我的情况下起作用。谢谢:)