zoukankan      html  css  js  c++  java
  • 学习笔记之(console)

    今天小颖在逛博客园时,发现一位帅锅写的有意思的Console小颖看了后,就自己敲了一遍嘻嘻,为了方便以后查看,小颖把它记录下来嘻嘻,有兴趣的小伙伴也可以自己试试哦。

    格式占位符 作用
    %s 字符串
    %d or %i 整数
    %f 浮点数
    %o 可展开的DOM
    %O 列出DOM属性
    %c 根据提供的CSS样式格式化字符串

    1.%s(字符串)

        <script type="text/javascript">
            console.log("%s", "hello!");
            console.log("%s", "小颖是个爱喝酸奶的汉纸!");
        </script>

    2.%d and %i

        <script type="text/javascript">
            console.log("%d", "55.22");
            console.log("%d", 55.22);
            console.log("%d", 55.6);
            console.log("%i", "55.22");
            console.log("%i", 55.22);
            console.log("%i", 55.67);
        </script>

    3.%f

        <script type="text/javascript">
            console.log("%f", "55.67");
            console.log("%f", 55.67);
        </script>

    4.%o

    5.%O

    6.%c

        <script type="text/javascript">
            console.log("%c%s", "color: red; background: yellow; font-size: 40px;", "警告,请不要在此粘贴执行任何内容,这可能会导致您的账户安去带来威胁,给您带来损失!");
            console.log("如有任何疑问请联系%c0755-836xxxx", "color:red;font-weight:bold;");
            console.log("%c%s", "color:pink;font-size:20px;", "警告,请不要在此粘贴执行任何内容,这可能会导致您的账户安去带来威胁,给您带来损失!");
            console.log("%c如有任何疑问请联系0755-836xxxx", "color:green;font-weight:bold;");
            console.log("%c    ", "background: url(http://images2015.cnblogs.com/blog/813088/201611/813088-20161129115538756-21141764.jpg) no-repeat left center;font-size: 300px;", "
    ");
        </script>

  • 相关阅读:
    Minio对象存储
    白话解说TCP/IP协议三次握手和四次挥手
    企业环境下MySQL5.5调优
    Mac下iTerm2配置lrzsz功能
    七牛云图床和Markdown使用
    SSIS: 把存储在数据库中的图片导出来
    关闭Outlook的时候使之最小化
    【转】CTE(公用表表达式)
    通过SSIS监控远程服务器磁盘空间并发送邮件报警
    在Windows Server 2008 R2 中架设 SMTP 服务器
  • 原文地址:https://www.cnblogs.com/yingzi1028/p/6122669.html
Copyright © 2011-2022 走看看