Skip to content

[html] 第169天 什么是Data URI? #1283

@haizhilin2013

Description

@haizhilin2013
Collaborator

第169天 什么是Data URI?

Activity

wwqin

wwqin commented on Oct 2, 2019

@wwqin

Data URLs,即前缀为 data: 协议的URL,其允许内容创建者向文档中嵌入小文件。
data:text/html,<script>alert('hi');</script>
一个会执行 JavaScript alert 的 HTML 文档。

vkboo

vkboo commented on Oct 2, 2019

@vkboo
  • 概念:把小文件直接嵌入文档的方案
  • 格式:data:[][;charset=][;base64],
  • 注意:使用base64的Data URI比直接使用外链的图片,性能会大大降低,所以在比较在乎性能的情况下要谨慎使用
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @haizhilin2013@vkboo@wwqin

        Issue actions

          [html] 第169天 什么是Data URI? · Issue #1283 · haizlin/fe-interview