从iframe中提取数据

时间:2018-06-19 11:47:07

标签: javascript jquery html json http

我想从iframe提取数据并使用JavaScript打印到任何类

示例:

var iBody = $("#getDataJson").contents().find("pre");
$('#hedl').html(iBody);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<iframe id="getDataJson" width="100%" height="100%" src="https://graph.facebook.com/v3.0/me?fields=id"></iframe>

这将产生Json格式的数据,我想通过JavaScript从它们中提取任何值,并使用将它们打印到任何类中

我在本地主机上的文件上尝试了它,并且没有任何问题,但是在添加远程链接(https://)时不起作用:(

有什么建议吗?

提前谢谢!

0 个答案:

没有答案