<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script>
iframe = document.createElement('iframe');
iframe.src = URL.createObjectURL(new Blob(["<div>我是div</div>"],{type:'text/html'}));
document.body.appendChild(iframe);
</script>
</body>
</html>
字符串元素转 Blob URL
猜你喜欢
转载自blog.csdn.net/mbh12333/article/details/103614801
今日推荐
周排行