[b]<html>[/b]
[b]<head>[/b]
[b]<script>[/b]
[COLOR=orange]addEventListener[/color][teal]([/teal][i][green]'load'[/green][/i][teal], () => {[/teal]
[gray]// get the iframe's content[/gray]
[b]var[/b] jsonText [teal]=[/teal] document[teal].[/teal][COLOR=orange]getElementById[/color][teal]([/teal][i][green]'source'[/green][/i][teal]).[/teal]contentDocument[teal].[/teal]body[teal].[/teal]textContent
[gray]// and use it for something, but still as string[/gray]
document[teal].[/teal][COLOR=orange]getElementById[/color][teal]([/teal][i][green]'destination'[/green][/i][teal]).[/teal]value [teal]=[/teal] jsonText
[gray]// now log it to console as JavaScript object[/gray]
console[teal].[/teal][COLOR=orange]log[/color][teal]([/teal][i][green]'JSON copied from iframe to textarea is :'[/green][/i][teal],[/teal] JSON[teal].[/teal][COLOR=orange]parse[/color][teal]([/teal]jsonText[teal]))[/teal]
[teal]})[/teal]
[b]</script>[/b]
[b]</head>[/b]
[b]<body>[/b]
JSON in iframe :[b]<br><iframe[/b] [maroon]src[/maroon][teal]=[/teal][i][green]"peterpann.json"[/green][/i] [maroon]id[/maroon][teal]=[/teal][i][green]"source"[/green][/i][b]></iframe>[/b]
[b]<hr>[/b]
JSON in textarea :[b]<br><textarea[/b] [maroon]id[/maroon][teal]=[/teal][i][green]"destination"[/green][/i][b]></textarea>[/b]
[b]</body>[/b]
[b]</html>[/b]