fetch("http://api.com/api/query?id=1").
then(ret=>ret.json()).then(ret=>{
$("#Name").text("Nick: "+ret.data.name);
$("#Year").text("Years old: "+ret.data.year)
})
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8" />
<title>MySite</title>
<meta name='viewport' content='width=device-width,initial-scale=1'/>
<meta content='true' name='HandheldFriendly'/>
<meta content='width' name='MobileOptimized'/>
<meta content='yes' name='apple-mobile-web-app-capable'/>
<link rel="stylesheet" Type="text/css" href="main.css">
</head>
<script type="text/javascript" >
opolo = document.querySelector('#opolo').getAttribute('data-nme');
iframe = document.querySelector('iframe');
url = new URL(iframe.src);
url.searchParams.delete('post');
url.searchParams.append('post', opolo);
iframe.src = url.href;
</script>
<div id="opolo" data-nme="666" ></div>
<body>
<iframe src="https://mysite.com/?post=444555&user=49es42y5f5h84bsgf7a244dffb73374sds" frameborder="0" scrolling="no" allowfullscreen="" width="800" height="452"></iframe>
</body>
</html>