代码之家  ›  专栏  ›  技术社区  ›  Lamcee

如何在img标签的onerror属性上发送http请求?

  •  0
  • Lamcee  · 技术社区  · 8 年前

      <body>
         <img src=a onerror="document.write('<img src=\"http://www.somdomain.com:8088/alert?type=teSt&msg=www\">')">
      </body>
    
    1 回复  |  直到 8 年前
        1
  •  2
  •   Quentin    8 年前

    \ 不是HTML中的转义字符。

    " 属性值内的字符,以分隔 " 字符,必须将其表示为实体。例如 &quot; .


    请记住,跨原点限制可防止加载和错误事件从不同原点触发。