blog icon indicating copy to clipboard operation
blog copied to clipboard

无题.小知识点

Open anjia opened this issue 6 years ago • 1 comments

目录

anjia avatar Jan 09 '19 13:01 anjia

Data URLs

data urls ???????????? documents ?????? files

  • URLs ??? scheme data: ?????????
  • ?????? content creators???????????????????????? documents ????????? small files inline?????????????????????

????????????????????????data:[<mediatype>][;base64],data

  1. data: ??????
  2. MIME type???????????? text/plain;charset=US-ASCII
  3. base64
    • ??????????????? textual?????????????????????????????????????????????
    • ??????????????? non-textual??????????????????base64???????????? base64-encoded ??????????????????
  4. data

eg.

  • data:,Hello%2C%20World!
  • data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D
  • data:text/html,%3Ch1%3EHello%2C%20World!%3C%2Fh1%3E
  • data:text/html,<script>alert('hi');</script>

the "data" URL scheme

anjia avatar Jan 09 '19 13:01 anjia