标题:Vscode插件
只看楼主
吧啦哔哩啵
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2020-9-2
结帖率:100%
 问题点数:0 回复次数:0 
Vscode插件
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>往空白窗口输出一个页面</title>
    <script type="text/javascript">
        window.onload = function(){
            var obth = document.getElementById("bth");
            obth.onclick = function(){
                var opener = window.open();
                var strhtml = '<!DOCTYPE html>\
                                <html>\
                                <head>\
                                    <title>这是一个新网页</title>\
                                </head>\
                                <body>\
                                    <strong>小心偷影子的人,他会偷走你的心</strong>\
                                </body>\
                                </html>';

                opener.document.write(strhtml);
            };
        }
    </script>
</head>
<body>
    <input type="button" name="button" id="bth" value="打开">
</body>
</html>

以上是代码内容,在vscode中使用open with live server显示效果如下:

而在 open in defaul browser显示正常,这是为什么啊。默认浏览器都是Google Chrome
搜索更多相关主题的帖子: Vscode body title head html 
2020-10-28 16:18



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-503669-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.182242 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved